From 46f85c9b860d33d2c51ee7487bf1103f37e10a4c Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Mon, 30 Sep 2019 16:14:03 +0200 Subject: [PATCH] verifyChecksum fails for non-output files PR #967 introduced another error. Before verifyChecksum was used only from kojikamid and it made sense, that it failed on other files. Now it is used also for build requires, etc. As it makes no harm (read-only), we can extend this check for other paths. Fixes: https://pagure.io/koji/issue/1669 --- vm/kojivmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm/kojivmd b/vm/kojivmd index f9f3daa8..80c20b50 100755 --- a/vm/kojivmd +++ b/vm/kojivmd @@ -760,7 +760,8 @@ class VMExecTask(BaseTaskHandler): def verifyChecksum(self, path, checksum, algo='sha1'): local_path = os.path.abspath(os.path.join(self.output_dir, path)) - if not local_path.startswith(self.output_dir): + if not local_path.startswith(self.output_dir) and \ + not local_path.startswith(self.buildreq_dir): raise koji.BuildError('invalid path: %s' % path) if not os.path.isfile(local_path): raise koji.BuildError('%s does not exist' % local_path)