#1670 verifyChecksum fails for non-output files
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue1669  into  master

file modified
+2 -1
@@ -759,7 +759,8 @@ 

  

      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)

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

Commit d5f67d6 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago