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
337f806f
Commit
337f806f
authored
3 years ago
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn some error conditions into assertions (part 2)
parent
3ff6e747
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
__init__.py
kconfig_hardened_check/__init__.py
+6
-5
No files found.
kconfig_hardened_check/__init__.py
View file @
337f806f
...
...
@@ -252,9 +252,10 @@ class OR(ComplexOptCheck):
self
.
result
=
'OK: {} not found'
.
format
(
opt
.
name
)
elif
opt
.
result
==
'OK: is present'
:
self
.
result
=
'OK: {} is present'
.
format
(
opt
.
name
)
# VersionCheck provides enough info
elif
not
opt
.
result
.
startswith
(
'OK: version'
):
sys
.
exit
(
'[!] ERROR: unexpected OK description "{}"'
.
format
(
opt
.
result
))
else
:
# VersionCheck provides enough info
assert
(
opt
.
result
.
startswith
(
'OK: version'
)),
\
'unexpected OK description "{}"'
.
format
(
opt
.
result
)
return
self
.
result
=
self
.
opts
[
0
]
.
result
...
...
@@ -282,8 +283,8 @@ class AND(ComplexOptCheck):
else
:
# VersionCheck provides enough info
self
.
result
=
opt
.
result
if
not
opt
.
result
.
startswith
(
'FAIL: version'
):
sys
.
exit
(
'[!] ERROR: unexpected FAIL description "{}"'
.
format
(
opt
.
result
)
)
assert
(
opt
.
result
.
startswith
(
'FAIL: version'
)),
\
'unexpected FAIL description "{}"'
.
format
(
opt
.
result
)
return
...
...
This diff is collapsed.
Click to expand it.
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