mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
Handle ldd $? == 1 in get_reqs()
ldd exits with $? == 1 if a file is 'not a dynamic executable'. This is correct behaviour of ldd, so we should handle it instead of raising an exception ;-) [not in 2.9 and 2.10] Also extend fake_ldd and add a test to test-aa.py to cover this. Note that 2.10 and 2.9 don't have tests for get_reqs() nor fake_ldd, so those branches will only get the aa.py changes. Acked-by: John Johansen <john.johansen@canonical.com> for trunk, 2.10 and 2.9.
This commit is contained in:
parent
105dfb2a9d
commit
66280702af
1 changed files with 2 additions and 2 deletions
|
@ -354,9 +354,9 @@ def get_reqs(file):
|
|||
pattern2 = re.compile('^\s*(\/\S+)')
|
||||
reqs = []
|
||||
ret, ldd_out = get_output([ldd, file])
|
||||
if ret == 0:
|
||||
if ret == 0 or ret == 1:
|
||||
for line in ldd_out:
|
||||
if 'not a dynamic executable' in line:
|
||||
if 'not a dynamic executable' in line: # comes with ret == 1
|
||||
break
|
||||
if 'cannot read header' in line:
|
||||
break
|
||||
|
|
Loading…
Add table
Reference in a new issue