Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kernel-hardening-checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
kernel-hardening-checker
Commits
5a298be1
Commit
5a298be1
authored
Dec 30, 2023
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show the option type in print_unknown_options()
That improves debugging.
parent
e2815728
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
__init__.py
kernel_hardening_checker/__init__.py
+6
-7
No files found.
kernel_hardening_checker/__init__.py
View file @
5a298be1
...
@@ -80,7 +80,7 @@ def detect_compiler(fname):
...
@@ -80,7 +80,7 @@ def detect_compiler(fname):
sys
.
exit
(
f
'[!] ERROR: invalid GCC_VERSION and CLANG_VERSION: {gcc_version} {clang_version}'
)
sys
.
exit
(
f
'[!] ERROR: invalid GCC_VERSION and CLANG_VERSION: {gcc_version} {clang_version}'
)
def
print_unknown_options
(
checklist
,
parsed_options
):
def
print_unknown_options
(
checklist
,
parsed_options
,
opt_type
):
known_options
=
[]
known_options
=
[]
for
o1
in
checklist
:
for
o1
in
checklist
:
...
@@ -100,7 +100,7 @@ def print_unknown_options(checklist, parsed_options):
...
@@ -100,7 +100,7 @@ def print_unknown_options(checklist, parsed_options):
for
option
,
value
in
parsed_options
.
items
():
for
option
,
value
in
parsed_options
.
items
():
if
option
not
in
known_options
:
if
option
not
in
known_options
:
print
(
f
'[?] No check for option {option} ({value})'
)
print
(
f
'[?] No check for
{opt_type}
option {option} ({value})'
)
def
print_checklist
(
mode
,
checklist
,
with_results
):
def
print_checklist
(
mode
,
checklist
,
with_results
):
...
@@ -335,12 +335,11 @@ def main():
...
@@ -335,12 +335,11 @@ def main():
if
mode
==
'verbose'
:
if
mode
==
'verbose'
:
# print the parsed options without the checks (for debugging)
# print the parsed options without the checks (for debugging)
all_parsed_options
=
parsed_kconfig_options
# assignment does not copy
print_unknown_options
(
config_checklist
,
parsed_kconfig_options
,
'kconfig'
)
if
args
.
cmdline
:
if
args
.
cmdline
:
all_parsed_options
.
update
(
parsed_cmdline_options
)
print_unknown_options
(
config_checklist
,
parsed_cmdline_options
,
'cmdline'
)
if
args
.
sysctl
:
if
args
.
sysctl
:
all_parsed_options
.
update
(
parsed_sysctl_options
)
print_unknown_options
(
config_checklist
,
parsed_sysctl_options
,
'sysctl'
)
print_unknown_options
(
config_checklist
,
all_parsed_options
)
# finally print the results
# finally print the results
print_checklist
(
mode
,
config_checklist
,
True
)
print_checklist
(
mode
,
config_checklist
,
True
)
...
@@ -371,7 +370,7 @@ def main():
...
@@ -371,7 +370,7 @@ def main():
if
mode
==
'verbose'
:
if
mode
==
'verbose'
:
# print the parsed options without the checks (for debugging)
# print the parsed options without the checks (for debugging)
print_unknown_options
(
config_checklist
,
parsed_sysctl_options
)
print_unknown_options
(
config_checklist
,
parsed_sysctl_options
,
'sysctl'
)
# finally print the results
# finally print the results
print_checklist
(
mode
,
config_checklist
,
True
)
print_checklist
(
mode
,
config_checklist
,
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment