From 13a070319b71e945da70b72ee3762101d2c13905 Mon Sep 17 00:00:00 2001 From: Thibault Ayanides Date: Mon, 14 Dec 2020 15:11:33 +0100 Subject: [PATCH] IMP(6.2.13): fix race condition --- bin/hardening/6.2.13_set_perm_on_user_netrc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hardening/6.2.13_set_perm_on_user_netrc.sh b/bin/hardening/6.2.13_set_perm_on_user_netrc.sh index cd8bf30..cfca955 100755 --- a/bin/hardening/6.2.13_set_perm_on_user_netrc.sh +++ b/bin/hardening/6.2.13_set_perm_on_user_netrc.sh @@ -45,7 +45,7 @@ audit() { # This function will be called if the script status is on enabled mode apply() { - for DIR in $(cat /etc/passwd | grep -Ev '(root|halt|sync|shutdown)' | awk -F: '($7 != "/usr/sbin/nologin" && $7 != "/bin/false" && $7 !="/nonexistent" ) { print $6 }'); do + for DIR in $(get_db passwd | grep -Ev '(root|halt|sync|shutdown)' | awk -F: '($7 != "/usr/sbin/nologin" && $7 != "/bin/false" && $7 !="/nonexistent" ) { print $6 }'); do debug "Working on $DIR" for FILE in $DIR/.netrc; do if [ ! -h "$FILE" ] && [ -f "$FILE" ]; then