From 0a0d1c8c8b85b273caf4d272a155c432160ec6f2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 8 Jun 2017 07:21:07 +0200 Subject: sb: Restrict file name length --- source-builder/sb/download.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py index dd7880d..ea7f4f4 100644 --- a/source-builder/sb/download.py +++ b/source-builder/sb/download.py @@ -184,6 +184,10 @@ def _http_parser(source, pathkey, config, opts): # Wipe out everything special in the file name. # source['file'] = re.sub(r'[^a-zA-Z0-9.\-]+', '-', source['file']) + max_file_len = 127 + if len(source['file']) > max_file_len: + raise error.general('file name length is greater than %i (maybe use --rsb-file=FILE option): %s' % \ + (max_file_len, source['file'])) # # Check local path # -- cgit v1.2.3