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
b9e670c3
Commit
b9e670c3
authored
Mar 27, 2022
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the CmdlineCheck class
parent
12c2af7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
__init__.py
kconfig_hardened_check/__init__.py
+12
-6
No files found.
kconfig_hardened_check/__init__.py
View file @
b9e670c3
...
@@ -132,6 +132,12 @@ class OptCheck:
...
@@ -132,6 +132,12 @@ class OptCheck:
if
with_results
:
if
with_results
:
print
(
'| {}'
.
format
(
self
.
result
),
end
=
''
)
print
(
'| {}'
.
format
(
self
.
result
),
end
=
''
)
def
json_dump
(
self
,
with_results
):
dump
=
[
self
.
name
,
self
.
type
,
self
.
expected
,
self
.
decision
,
self
.
reason
]
if
with_results
:
dump
.
append
(
self
.
result
)
return
dump
class
KconfigCheck
(
OptCheck
):
class
KconfigCheck
(
OptCheck
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
@@ -142,11 +148,11 @@ class KconfigCheck(OptCheck):
...
@@ -142,11 +148,11 @@ class KconfigCheck(OptCheck):
def
type
(
self
):
def
type
(
self
):
return
'kconfig'
return
'kconfig'
def
json_dump
(
self
,
with_results
):
dump
=
[
self
.
name
,
self
.
type
,
self
.
expected
,
self
.
decision
,
self
.
reason
]
class
CmdlineCheck
(
OptCheck
):
if
with_results
:
@property
dump
.
append
(
self
.
result
)
def
type
(
self
):
return
dump
return
'cmdline'
class
VersionCheck
:
class
VersionCheck
:
...
@@ -185,7 +191,7 @@ class ComplexOptCheck:
...
@@ -185,7 +191,7 @@ class ComplexOptCheck:
sys
.
exit
(
'[!] ERROR: empty {} check'
.
format
(
self
.
__class__
.
__name__
))
sys
.
exit
(
'[!] ERROR: empty {} check'
.
format
(
self
.
__class__
.
__name__
))
if
len
(
self
.
opts
)
==
1
:
if
len
(
self
.
opts
)
==
1
:
sys
.
exit
(
'[!] ERROR: useless {} check'
.
format
(
self
.
__class__
.
__name__
))
sys
.
exit
(
'[!] ERROR: useless {} check'
.
format
(
self
.
__class__
.
__name__
))
if
not
isinstance
(
opts
[
0
],
KconfigCheck
):
if
not
isinstance
(
opts
[
0
],
KconfigCheck
)
and
not
isinstance
(
opts
[
0
],
CmdlineCheck
)
:
sys
.
exit
(
'[!] ERROR: invalid {} check: {}'
.
format
(
self
.
__class__
.
__name__
,
opts
))
sys
.
exit
(
'[!] ERROR: invalid {} check: {}'
.
format
(
self
.
__class__
.
__name__
,
opts
))
self
.
result
=
None
self
.
result
=
None
...
...
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