[rtems-source-builder commit] sb: Restrict file name length

Sebastian Huber sebh at rtems.org
Thu Jun 8 05:59:44 UTC 2017


Module:    rtems-source-builder
Branch:    master
Commit:    0a0d1c8c8b85b273caf4d272a155c432160ec6f2
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=0a0d1c8c8b85b273caf4d272a155c432160ec6f2

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jun  8 07:21:07 2017 +0200

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
     #



More information about the vc mailing list