From 706dba104d201de4eed6886bf9570bf6851c2c3f Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Fri, 20 Dec 2019 03:19:12 -0500 Subject: [PATCH] code simplification --- usr/lib/security-misc/permission-hardening | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr/lib/security-misc/permission-hardening b/usr/lib/security-misc/permission-hardening index 8ca1f47..b7aabb7 100755 --- a/usr/lib/security-misc/permission-hardening +++ b/usr/lib/security-misc/permission-hardening @@ -97,7 +97,11 @@ set_file_perms() { continue fi - if [ ! "$mode_from_config" = "nosuid" ]; then + 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