[Git][reproducible-builds/diffoscope][master] pgpdump(1) can successfully parse some binary files, so check that the parsed...

Chris Lamb gitlab at salsa.debian.org
Sat Aug 22 10:54:02 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
156f2398 by Chris Lamb at 2020-08-22T11:53:12+01:00
pgpdump(1) can successfully parse some binary files, so check that the parsed output contains something remotely sensible.

- - - - -


1 changed file:

- diffoscope/comparators/pgp.py


Changes:

=====================================
diffoscope/comparators/pgp.py
=====================================
@@ -54,14 +54,15 @@ class PgpFile(File):
     def fallback_recognizes(cls, file):
         if file.magic_file_type == "data":
             try:
-                our_check_output(
+                output = our_check_output(
                     ("pgpdump", file.path), stderr=subprocess.DEVNULL
                 )
             except subprocess.CalledProcessError:
                 pass
             else:
-                logger.debug("%s is a PGP file", file.path)
-                return True
+                if b"New: unknown" not in output:
+                    logger.debug("%s is a PGP file", file.path)
+                    return True
 
             logger.debug("%s is not a PGP file", file.path)
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/156f239851da22cc587cb04ab606340712990dbd

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/156f239851da22cc587cb04ab606340712990dbd
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200822/2ba5b0e8/attachment.htm>


More information about the rb-commits mailing list