From 46f85c9b860d33d2c51ee7487bf1103f37e10a4c Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Oct 15 2019 07:10:10 +0000 Subject: 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 --- diff --git a/vm/kojivmd b/vm/kojivmd index f9f3daa..80c20b5 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)