mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
scanner: ignore well known image types that are set executable
This commit is contained in:
parent
83edb5b80a
commit
3bc246ccad
1 changed files with 4 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import imghdr
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -196,6 +197,8 @@ def scan_source(build_dir, build=metadata.Build()):
|
||||||
for sp in safe_paths:
|
for sp in safe_paths:
|
||||||
if sp.match(path):
|
if sp.match(path):
|
||||||
return True
|
return True
|
||||||
|
if imghdr.what(path) is not None:
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
gradle_compile_commands = get_gradle_compile_commands(build)
|
gradle_compile_commands = get_gradle_compile_commands(build)
|
||||||
|
@ -277,7 +280,7 @@ def scan_source(build_dir, build=metadata.Build()):
|
||||||
|
|
||||||
elif is_executable(filepath):
|
elif is_executable(filepath):
|
||||||
if is_binary(filepath) and not safe_path(path_in_build_dir):
|
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:
|
for p in scanignore:
|
||||||
if p not in scanignore_worked:
|
if p not in scanignore_worked:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue