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
575ae82a
Commit
575ae82a
authored
Aug 14, 2023
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test an unexpected line in the sysctl file
parent
5c17fe62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
functional_test.sh
.github/workflows/functional_test.sh
+5
-0
__init__.py
kconfig_hardened_check/__init__.py
+1
-1
No files found.
.github/workflows/functional_test.sh
View file @
575ae82a
...
...
@@ -125,4 +125,9 @@ echo 'hey man 1' > cmdline
echo
'hey man 2'
>>
cmdline
coverage run
-a
--branch
bin/kconfig-hardened-check
-c
test.config
-l
cmdline
&&
exit
1
echo
">>>>> unexpected line in the sysctl file <<<<<"
cp
$SYSCTL_EXAMPLE
error_sysctls
echo
'some strange line'
>>
error_sysctls
coverage run
-a
--branch
bin/kconfig-hardened-check
-c
test.config
-s
error_sysctls
&&
exit
1
echo
"The end of the functional tests"
kconfig_hardened_check/__init__.py
View file @
575ae82a
...
...
@@ -205,7 +205,7 @@ def parse_sysctl_file(mode, parsed_options, fname):
for
line
in
f
.
readlines
():
line
=
line
.
strip
()
if
not
sysctl_pattern
.
match
(
line
):
sys
.
exit
(
f
'[!] ERROR: unexpected line in sysctl file:
{line}
'
)
sys
.
exit
(
f
'[!] ERROR: unexpected line in sysctl file:
"{line}"
'
)
option
,
value
=
line
.
split
(
'='
,
1
)
option
=
option
.
strip
()
value
=
value
.
strip
()
...
...
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