Add check for malformed dst filename in [files] section
authorClifford Wolf <clifford@clifford.at>
Fri, 13 Apr 2018 16:03:35 +0000 (18:03 +0200)
committerClifford Wolf <clifford@clifford.at>
Fri, 13 Apr 2018 16:03:35 +0000 (18:03 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
sbysrc/sby_core.py

index 8a8fa2debf47cb2e81b9f4649b7819be135b4490..cf794d954a6478ffd4ada370248dd58c5afe5f7b 100644 (file)
@@ -230,6 +230,8 @@ class SbyJob:
                     f.write(line)
 
         for dstfile, srcfile in self.files.items():
+            if dstfile.startswith("/") or dstfile.startswith("../") or ("/../" in dstfile):
+                self.error("destination filename must be a relative path without /../: %s" % dstfile)
             dstfile = self.workdir + "/src/" + dstfile
 
             if srcfile.startswith("~/"):