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
4a098724
Commit
4a098724
authored
Jul 15, 2020
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve ComplexOptCheck use cases
parent
01cd4043
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
__init__.py
kconfig_hardened_check/__init__.py
+6
-4
No files found.
kconfig_hardened_check/__init__.py
View file @
4a098724
...
...
@@ -178,9 +178,9 @@ class ComplexOptCheck:
class
OR
(
ComplexOptCheck
):
# self.opts[0] is the option that this OR-check is about.
# Use case:
# Use case
s
:
# OR(<X_is_hardened>, <X_is_disabled>)
# OR(<X_is_hardened>, <
X_is_hardened_ol
d>)
# OR(<X_is_hardened>, <
old_X_is_hardene
d>)
def
check
(
self
):
if
not
self
.
opts
:
...
...
@@ -200,8 +200,10 @@ class OR(ComplexOptCheck):
class
AND
(
ComplexOptCheck
):
# self.opts[0] is the option that this AND-check is about.
# Use case: AND(<suboption>, <main_option>)
# Use cases:
# AND(<suboption>, <main_option>)
# Suboption is not checked if checking of the main_option is failed.
# AND(<X_is_disabled>, <old_X_is_disabled>)
def
check
(
self
):
for
i
,
opt
in
reversed
(
list
(
enumerate
(
self
.
opts
))):
...
...
@@ -211,7 +213,7 @@ class AND(ComplexOptCheck):
return
ret
if
not
ret
:
if
hasattr
(
opt
,
'expected'
):
self
.
result
=
'FAIL: CONFIG_{}
is needed'
.
format
(
opt
.
name
)
self
.
result
=
'FAIL: CONFIG_{}
not "{}"'
.
format
(
opt
.
name
,
opt
.
expected
)
else
:
self
.
result
=
opt
.
result
return
False
...
...
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