Skip to content

Commit

Permalink
engine: Consider 'is not set' as off
Browse files Browse the repository at this point in the history
  • Loading branch information
a13xp0p0v committed Nov 23, 2024
1 parent 3b65f77 commit 6b34070
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel_hardening_checker/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def check(self) -> None:
if self.expected == 'is not off':
if self.state == 'off':
self.result = 'FAIL: is off'
elif self.state == '0':
self.result = 'FAIL: is off, "0"'
elif self.state == '0' or self.state == 'is not set':
self.result = f'FAIL: is off, "{self.state}"'
elif self.state is None:
self.result = 'FAIL: is off, not found'
else:
Expand Down Expand Up @@ -316,7 +316,7 @@ def check(self) -> None:
self.result = f'FAIL: {opt.name} is not "{opt.expected}"'
elif opt.result == 'FAIL: is not present':
self.result = f'FAIL: {opt.name} is not present'
elif opt.result in ('FAIL: is off', 'FAIL: is off, "0"'):
elif opt.result in ('FAIL: is off', 'FAIL: is off, "0"', 'FAIL: is off, "is not set"'):
self.result = f'FAIL: {opt.name} is off'
else:
assert(opt.result == 'FAIL: is off, not found'), \
Expand Down

0 comments on commit 6b34070

Please sign in to comment.