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
0b8e9770
Commit
0b8e9770
authored
Mar 12, 2019
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce the ComplexOptCheck superclass
parent
646cc660
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
kconfig-hardened-check.py
kconfig-hardened-check.py
+8
-6
No files found.
kconfig-hardened-check.py
View file @
0b8e9770
...
@@ -68,16 +68,11 @@ class OptCheck:
...
@@ -68,16 +68,11 @@ class OptCheck:
return
'{} = {}'
.
format
(
self
.
name
,
self
.
state
)
return
'{} = {}'
.
format
(
self
.
name
,
self
.
state
)
class
OR
:
class
ComplexOptCheck
:
def
__init__
(
self
,
*
opts
):
def
__init__
(
self
,
*
opts
):
self
.
opts
=
opts
self
.
opts
=
opts
self
.
result
=
None
self
.
result
=
None
# self.opts[0] is the option which this OR-check is about.
# Use case:
# OR(<X_is_hardened>, <X_is_disabled>)
# OR(<X_is_hardened>, <X_is_hardened_old>)
@property
@property
def
name
(
self
):
def
name
(
self
):
return
self
.
opts
[
0
]
.
name
return
self
.
opts
[
0
]
.
name
...
@@ -98,6 +93,13 @@ class OR:
...
@@ -98,6 +93,13 @@ class OR:
def
reason
(
self
):
def
reason
(
self
):
return
self
.
opts
[
0
]
.
reason
return
self
.
opts
[
0
]
.
reason
class
OR
(
ComplexOptCheck
):
# self.opts[0] is the option which this OR-check is about.
# Use case:
# OR(<X_is_hardened>, <X_is_disabled>)
# OR(<X_is_hardened>, <X_is_hardened_old>)
def
check
(
self
):
def
check
(
self
):
for
i
,
opt
in
enumerate
(
self
.
opts
):
for
i
,
opt
in
enumerate
(
self
.
opts
):
result
,
msg
=
opt
.
check
()
result
,
msg
=
opt
.
check
()
...
...
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