Skip to content

Commit 6fd0ae9

Browse files
committed
security: find kconfig binary
1 parent 266f03e commit 6fd0ae9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hooks/security.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class ChecksecFile:
2626
class SecurityHook(Hook):
2727

2828
CHECKSEC_BIN = Path(__file__).parent.parent/"tools"/"checksec"/"checksec"
29+
KCONFIG_BIN = Path(__file__).parent.parent/"tools"/"kconfig-hardened-check"/"kconfig-hardened-check.py"
2930

3031
def __init__(self, parameters):
3132
super().__init__(parameters)
@@ -34,6 +35,10 @@ def __init__(self, parameters):
3435
raise RuntimeError('Cannot find checksec, did you forget to init the submodule ?')
3536
self.checksec = str(self.CHECKSEC_BIN)
3637

38+
if not self.KCONFIG_BIN.exists():
39+
raise RuntimeError('Cannot find kconfig-hardened-check, did you forget to init the submodule ?')
40+
self.kconfig = str(self.KCONFIG_BIN)
41+
3742
self.context.subscribe('filesystem_new_file_mime', self.check_file)
3843

3944
def check_file(self, event):

0 commit comments

Comments
 (0)