projects
/
kconfig-hardened-check.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
985aa05
)
Fix the fresh set_state() bug found by unittest
author
Alexander Popov
<alex.popov@linux.com>
Sat, 9 Mar 2024 21:41:49 +0000
(
00:41
+0300)
committer
Alexander Popov
<alex.popov@linux.com>
Sat, 9 Mar 2024 21:41:49 +0000
(
00:41
+0300)
This function should write 'self.state' anyway.
Refers to #88, #89, #97
kernel_hardening_checker/engine.py
patch
|
blob
|
history
diff --git
a/kernel_hardening_checker/engine.py
b/kernel_hardening_checker/engine.py
index 8ba34ef9a96949b392c1409eeef8966d42ad0c29..960f4f44c7278db7a2ee7ffe9e3e045fcb5bf7fc 100644
(file)
--- a/
kernel_hardening_checker/engine.py
+++ b/
kernel_hardening_checker/engine.py
@@
-62,10
+62,9
@@
class OptCheck:
return None
def set_state(self, data):
- if data:
- assert(isinstance(data, str)), \
+ assert(data is None or isinstance(data, str)), \
f'invalid state "{data}" for "{self.name}" check'
-
self.state = data
+ self.state = data
def check(self):
# handle the 'is present' check