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
866d3c07
Commit
866d3c07
authored
Feb 14, 2022
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve print_unknown_options()
Don't miss options behind the second level of ComplexOptCheck
parent
70975c39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
__init__.py
kconfig_hardened_check/__init__.py
+17
-8
No files found.
kconfig_hardened_check/__init__.py
View file @
866d3c07
...
...
@@ -614,16 +614,25 @@ def add_kconfig_checks(l, arch):
def
print_unknown_options
(
checklist
,
parsed_options
):
known_options
=
[]
for
opt
in
checklist
:
if
hasattr
(
opt
,
'opts'
):
for
o
in
opt
.
opts
:
if
hasattr
(
o
,
'name'
):
known_options
.
append
(
o
.
name
)
else
:
known_options
.
append
(
opt
.
name
)
for
o1
in
checklist
:
if
not
hasattr
(
o1
,
'opts'
):
known_options
.
append
(
o1
.
name
)
continue
for
o2
in
o1
.
opts
:
if
not
hasattr
(
o2
,
'opts'
):
if
hasattr
(
o2
,
'name'
):
known_options
.
append
(
o2
.
name
)
continue
for
o3
in
o2
.
opts
:
if
hasattr
(
o3
,
'opts'
):
sys
.
exit
(
'[!] ERROR: unexpected ComplexOptCheck inside {}'
.
format
(
o2
.
name
))
if
hasattr
(
o3
,
'name'
):
known_options
.
append
(
o3
.
name
)
for
option
,
value
in
parsed_options
.
items
():
if
option
not
in
known_options
:
print
(
'[?] No
rule
for option {} ({})'
.
format
(
option
,
value
))
print
(
'[?] No
check
for option {} ({})'
.
format
(
option
,
value
))
def
print_checklist
(
mode
,
checklist
,
with_results
):
...
...
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