[Git][reproducible-builds/debian-rebuilder-setup][master] Add very basic sanity check

kpcyrd gitlab at salsa.debian.org
Mon Nov 5 22:43:21 CET 2018


kpcyrd pushed to branch master at Reproducible Builds / debian-rebuilder-setup


Commits:
b3cb0409 by kpcyrd at 2018-11-05T21:44:08Z
Add very basic sanity check

- - - - -


1 changed file:

- visualizer/accumulator.py


Changes:

=====================================
visualizer/accumulator.py
=====================================
@@ -18,6 +18,11 @@ def get_db():
     return db
 
 
+def enforce_sane_dirent_name(name):
+    if '/' in name or name.startswith('.'):
+        raise Exception('Illegal dirent name')
+
+
 @app.teardown_appcontext
 def close_connection(exception):
     db = getattr(g, '_database', None)
@@ -38,9 +43,16 @@ def new_build():
             if item[0] == 'Version':
                 version = item[1]
     buildinfo.seek(0)
+
     folder_name = '%s-%s' % (source, version)
+    enforce_sane_dirent_name(folder_name)
+
     directory = join(DIR, folder_name)
     mkdir(directory)
+
+    enforce_sane_dirent_name(metadata.filename)
+    enforce_sane_dirent_name(buildinfo.filename)
+
     timestamp = time()
     metadata.save(join(directory, metadata.filename))
     buildinfo.save(join(directory, buildinfo.filename))



View it on GitLab: https://salsa.debian.org/reproducible-builds/debian-rebuilder-setup/commit/b3cb04095067881d6e65550702c1ecfd468e4707

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/debian-rebuilder-setup/commit/b3cb04095067881d6e65550702c1ecfd468e4707
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20181105/4eff79c7/attachment.html>


More information about the rb-commits mailing list