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
c69de43e
Commit
c69de43e
authored
Jun 09, 2022
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn some error conditions into assertions (part 3)
parent
337f806f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
__init__.py
kconfig_hardened_check/__init__.py
+8
-8
No files found.
kconfig_hardened_check/__init__.py
View file @
c69de43e
...
@@ -676,8 +676,8 @@ def print_unknown_options(checklist, parsed_options):
...
@@ -676,8 +676,8 @@ def print_unknown_options(checklist, parsed_options):
known_options
.
append
(
o2
.
name
)
known_options
.
append
(
o2
.
name
)
continue
continue
for
o3
in
o2
.
opts
:
for
o3
in
o2
.
opts
:
if
o3
.
type
==
'complex'
:
assert
(
o3
.
type
!=
'complex'
),
\
sys
.
exit
(
'[!] ERROR: unexpected ComplexOptCheck inside {}'
.
format
(
o2
.
name
)
)
'unexpected ComplexOptCheck inside {}'
.
format
(
o2
.
name
)
if
hasattr
(
o3
,
'name'
):
if
hasattr
(
o3
,
'name'
):
known_options
.
append
(
o3
.
name
)
known_options
.
append
(
o3
.
name
)
...
@@ -735,12 +735,12 @@ def print_checklist(mode, checklist, with_results):
...
@@ -735,12 +735,12 @@ def print_checklist(mode, checklist, with_results):
def
populate_simple_opt_with_data
(
opt
,
data
,
data_type
):
def
populate_simple_opt_with_data
(
opt
,
data
,
data_type
):
if
opt
.
type
==
'complex'
:
assert
(
opt
.
type
!=
'complex'
),
\
sys
.
exit
(
'[!] ERROR: unexpected ComplexOptCheck {}: {}'
.
format
(
opt
.
name
,
vars
(
opt
))
)
'unexpected ComplexOptCheck "{}"'
.
format
(
opt
.
name
)
if
opt
.
type
not
in
SIMPLE_OPTION_TYPES
:
assert
(
opt
.
type
in
SIMPLE_OPTION_TYPES
),
\
sys
.
exit
(
'[!] ERROR: invalid opt type "{}" for {}'
.
format
(
opt
.
type
,
opt
.
name
)
)
'invalid opt type "{}"'
.
format
(
opt
.
type
)
if
data_type
not
in
SIMPLE_OPTION_TYPES
:
assert
(
data_type
in
SIMPLE_OPTION_TYPES
),
\
sys
.
exit
(
'[!] ERROR: invalid data type "{}"'
.
format
(
data_type
)
)
'invalid data type "{}"'
.
format
(
data_type
)
if
data_type
!=
opt
.
type
:
if
data_type
!=
opt
.
type
:
return
return
...
...
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