From 20b8a407ac5984ba621ebb0150b47067c32ddc76 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Fri, 20 Dec 2019 03:25:17 -0500 Subject: [PATCH] refactoring --- usr/lib/security-misc/permission-hardening | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/usr/lib/security-misc/permission-hardening b/usr/lib/security-misc/permission-hardening index 5b98062..c6cb6b8 100755 --- a/usr/lib/security-misc/permission-hardening +++ b/usr/lib/security-misc/permission-hardening @@ -92,18 +92,15 @@ set_file_perms() { nosuid="" if [ "$mode_from_config" = "nosuid" ]; then nosuid="true" + + ## If mode_from_config is "nosuid" the config does not set owner and + ## group. Therefore do not enforce owner/group check. else if ! seq -w 000 4777 | grep -qw "$mode_from_config"; then echo "ERROR: Mode '$mode_from_config' is invalid!" >&2 continue fi - fi - if [ "$mode_from_config" = "nosuid" ]; then - ## If mode_from_config is "nosuid" the config does not set owner and - ## group. Therefore do not enforce owner/group check. - true OK - else if ! getent passwd | grep -q "^${owner}:"; then echo "ERROR: User '$owner' does not exist!" >&2 continue