scripts: add MACHO NOUNDEFS check to security-check.py

This commit is contained in:
fanquake 2019-12-31 23:58:13 +03:00
parent 4ca92dc6d3
commit 7c9e821c4e
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -188,6 +188,15 @@ def check_MACHO_PIE(executable) -> bool:
return True return True
return False return False
def check_MACHO_NOUNDEFS(executable) -> bool:
'''
Check for no undefined references.
'''
flags = get_MACHO_executable_flags(executable)
if 'NOUNDEFS' in flags:
return True
return False
CHECKS = { CHECKS = {
'ELF': [ 'ELF': [
('PIE', check_ELF_PIE), ('PIE', check_ELF_PIE),
@ -202,6 +211,7 @@ CHECKS = {
], ],
'MACHO': [ 'MACHO': [
('PIE', check_MACHO_PIE), ('PIE', check_MACHO_PIE),
('NOUNDEFS', check_MACHO_NOUNDEFS),
] ]
} }