fix mode sanity check

no longer use seq due to issue

https://forums.whonix.org/t/permission-hardening/8655/13
This commit is contained in:
Patrick Schleizer 2019-12-20 08:02:30 -05:00
parent ddc0eec63d
commit d5f1bd8dd2
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -126,7 +126,12 @@ set_file_perms() {
add_nosuid_statoverride_entry
else
if ! seq -w 000 4777 | grep -qw "$mode_from_config"; then
string_length_of_mode_from_config="${#mode_from_config}"
if [ "$string_length_of_mode_from_config" -gt "4" ]; then
echo "ERROR: Mode '$mode_from_config' is invalid!" >&2
continue
fi
if [ "$string_length_of_mode_from_config" -lt "3" ]; then
echo "ERROR: Mode '$mode_from_config' is invalid!" >&2
continue
fi