exit with error if a config line cannot be processed rather than skipping

https://forums.whonix.org/t/disable-suid-binaries/7706/59
This commit is contained in:
Patrick Schleizer 2019-12-29 04:35:46 -05:00
parent d5c99f3a60
commit e3e1ff2a31
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -247,7 +247,9 @@ set_file_perms() {
else
exit_code=200
echo "ERROR: cannot parse line with invalid character. line: '$line'" >&2
continue
## Safer to exit with error in this case.
## https://forums.whonix.org/t/disable-suid-binaries/7706/59
exit "$exit_code"
fi
#global fso
@ -255,7 +257,9 @@ set_file_perms() {
if ! read -r fso mode_from_config owner_from_config group_from_config capability_from_config <<< "$line" ; then
exit_code=201
echo "ERROR: cannot parse. line: '$line'" >&2
continue
## Safer to exit with error in this case.
## https://forums.whonix.org/t/disable-suid-binaries/7706/59
exit "$exit_code"
fi
local fso_without_trailing_slash