From d5f1bd8dd29a4f9e1ccb6fed82a255f7b7abfe6f Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Fri, 20 Dec 2019 08:02:30 -0500 Subject: [PATCH] fix mode sanity check no longer use seq due to issue https://forums.whonix.org/t/permission-hardening/8655/13 --- usr/lib/security-misc/permission-hardening | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr/lib/security-misc/permission-hardening b/usr/lib/security-misc/permission-hardening index ac93d62..07b1be4 100755 --- a/usr/lib/security-misc/permission-hardening +++ b/usr/lib/security-misc/permission-hardening @@ -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