From 836d54d4c7a0db9072026d81bed1ca91c3c913a3 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 13 Apr 2018 18:03:35 +0200 Subject: [PATCH] Add check for malformed dst filename in [files] section Signed-off-by: Clifford Wolf --- sbysrc/sby_core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbysrc/sby_core.py b/sbysrc/sby_core.py index 8a8fa2d..cf794d9 100644 --- a/sbysrc/sby_core.py +++ b/sbysrc/sby_core.py @@ -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("~/"): -- 2.30.2