From 6b3407027e5827b84d0fc199e8313f97034ef0e8 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 24 Nov 2024 00:33:31 +0300 Subject: [PATCH] engine: Consider 'is not set' as off --- kernel_hardening_checker/engine.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel_hardening_checker/engine.py b/kernel_hardening_checker/engine.py index 45bebb4..f0ffdf2 100755 --- a/kernel_hardening_checker/engine.py +++ b/kernel_hardening_checker/engine.py @@ -93,8 +93,8 @@ class OptCheck: 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: @@ -316,7 +316,7 @@ class AND(ComplexOptCheck): 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'), \ -- 2.31.1