2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-01 06:45:38 +00:00

Set (instead of compare) exresult

Interestingly this accidentally worked because `if exresult` is true for
both a non-empty string ("PASS") as well as a real `True` value.

Found by Mark Grassi as part of
https://gitlab.com/apparmor/apparmor/-/merge_requests/906
This commit is contained in:
Christian Boltz
2022-08-14 12:33:56 +02:00
parent a555ccd9f4
commit 5a2fb8569c

View File

@@ -451,7 +451,7 @@ def parse_test_profiles(file_with_path):
if line.startswith('#=EXRESULT '):
exresult = line.split()[1]
if exresult == 'PASS':
exresult == True
exresult = True
exresult_found = True
elif exresult == 'FAIL':
exresult = False