Skip to content
Snippets Groups Projects
Commit 156f2398 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

pgpdump(1) can successfully parse some binary files, so check that the parsed...

pgpdump(1) can successfully parse some binary files, so check that the parsed output contains something remotely sensible.
parent b11ce9f7
No related branches found
No related tags found
No related merge requests found
Pipeline #167301 failed
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment