]> git.decadent.org.uk Git - dak.git/commitdiff
dep11-basic-validate: Forbid symlinks for now
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 22 May 2016 14:06:56 +0000 (16:06 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 22 May 2016 14:06:56 +0000 (16:06 +0200)
scripts/debian/dep11-basic-validate.py

index e6217b04affa748ffffda9ccd2cec35da4d52c4d..6ee3042b11f096a88b6268e12c50a6ec69decaa1 100755 (executable)
@@ -169,8 +169,12 @@ def validate_dir(dirname):
     ret = True
     for root, subfolders, files in os.walk(dirname):
         for fname in files:
+            fpath = os.path.join(root, fname)
+            if os.path.islink(fpath):
+                add_issue("FATAL: Symlinks are not allowed")
+                return False
             if fname.endswith(".yml.gz") or fname.endswith(".yml.xz"):
-                if not validate_file(os.path.join(root, fname)):
+                if not validate_file(fpath):
                     ret = False
 
     return ret
@@ -187,6 +191,9 @@ def main():
 
     if os.path.isdir(fname):
         ret = validate_dir(fname)
+    elif os.path.islink(fname):
+        add_issue("FATAL: Symlinks are not allowed")
+        ret = False
     else:
         ret = validate_file(fname)
     if ret: