From 3bc246ccad3169fc3662be9a206953de864bb21d Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 3 Jun 2020 14:34:21 +0200 Subject: [PATCH] scanner: ignore well known image types that are set executable --- fdroidserver/scanner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index 6560c4da..3ef9e06e 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import imghdr import json import os import re @@ -196,6 +197,8 @@ def scan_source(build_dir, build=metadata.Build()): for sp in safe_paths: if sp.match(path): return True + if imghdr.what(path) is not None: + return True return False gradle_compile_commands = get_gradle_compile_commands(build) @@ -277,7 +280,7 @@ def scan_source(build_dir, build=metadata.Build()): elif is_executable(filepath): if is_binary(filepath) and not safe_path(path_in_build_dir): - warnproblem('possible binary', path_in_build_dir) + warnproblem('executable binary, possibly code', path_in_build_dir) for p in scanignore: if p not in scanignore_worked: