From 88f396264ca9d072e4e5de4e1acaee54f3b39749 Mon Sep 17 00:00:00 2001 From: monsieuremre <130907164+monsieuremre@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:35:59 +0000 Subject: [PATCH] avoiding /etc/passwd --- usr/libexec/security-misc/permission-lockdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/libexec/security-misc/permission-lockdown b/usr/libexec/security-misc/permission-lockdown index 4449608..dfe0176 100755 --- a/usr/libexec/security-misc/permission-lockdown +++ b/usr/libexec/security-misc/permission-lockdown @@ -34,7 +34,7 @@ home_folder_access_rights_lockdown() { # Each users home directory to himself for user in $(dir /home); do # lists directories only - if [ grep --quiet "$user" /etc/passwd ]; then # check if user actually exists, and this is not some random directory + if [ $(id --user $user) ]; then # check if user actually exists, and this is not some random directory dpkg-statoverride --add --update $user $user 0700 /home/$user # home directory of the user itself echo "Permission updated: chmod go-rwx /home/$user" fi