mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-05-02 10:56:04 -04:00
fix, rework remount-secure kernel parameters parsing
This commit is contained in:
parent
b0181af099
commit
4288e10554
2 changed files with 7 additions and 5 deletions
|
@ -7,10 +7,12 @@
|
|||
## options based on kernel command line parameters.
|
||||
|
||||
remount_hook() {
|
||||
local remount_action
|
||||
remount_action=$(getarg remountsecure)
|
||||
local remountsecure_action
|
||||
## getarg returns the last parameter only.
|
||||
## if /proc/cmdline contains 'remountsecure=0 remountsecure=1 remountsecure=noexec' the last one wins.
|
||||
remountsecure_action=$(getarg remountsecure)
|
||||
|
||||
if getargbool 1 remountnoexec; then
|
||||
if [ "$remountsecure_action" = "1" ]; then
|
||||
if ! remount-secure --remountnoexec ; then
|
||||
warn "'remount-secure --remountnoexec' failed."
|
||||
return 1
|
||||
|
@ -19,7 +21,7 @@ remount_hook() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
if getargbool 1 remountsecure; then
|
||||
if [ "$remountsecure_action" = "noexec" ]; then
|
||||
if ! remount-secure ; then
|
||||
warn "'remount-secure' failed."
|
||||
return 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue