Merge pull request #48 from yunzheng/zip-support

Add support for processing files with .zip extension
This commit is contained in:
yunzheng
2021-12-18 15:06:30 +01:00
committed by GitHub

View File

@@ -56,7 +56,7 @@ except ImportError:
log = logging.getLogger(__name__)
# Java Archive Extensions
JAR_EXTENSIONS = (".jar", ".war", ".ear")
JAR_EXTENSIONS = (".jar", ".war", ".ear", ".zip")
# Filenames to find and MD5 hash (also recursively in JAR_EXTENSIONS)
# Currently we just look for JndiManager.class
@@ -175,6 +175,9 @@ def iter_jarfile(fobj, parents=None, stats=None):
log.debug(f"{fobj}: {e}")
except zipfile.BadZipFile as e:
log.debug(f"{fobj}: {e}")
except RuntimeError as e:
# RuntimeError: File 'encrypted.zip' is encrypted, password required for extraction
log.debug(f"{fobj}: {e}")
def red(s):