From 0b98515eec0e357af94e5aff2aa0035a6bf0ed52 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 8 Oct 2011 10:22:30 +0200 Subject: Use getent passwd (not awk directly on passwd file). --- localnotifypwexp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localnotifypwexp b/localnotifypwexp index 29811a7..03ecc51 100755 --- a/localnotifypwexp +++ b/localnotifypwexp @@ -41,7 +41,7 @@ declare -r disable=7 declare -r doesntmust=99999 declare -r warndefault=7 -passwdfile="/etc/passwd" +# fields in passwd file declare -r uidfield=3 declare -r unamefield=1 # UID range is system dependent @@ -94,12 +94,12 @@ declare -r hostconfig=local/notifypwexp [ ! -r /etc/$hostconfig ] || . /etc/$hostconfig # get real users -users=$($awkprog -F: -v uidfield=$uidfield \ +users=$(getent passwd | $awkprog -F: -v uidfield=$uidfield \ -v unamefield=$unamefield \ -v uidmin=$uidmin \ -v uidmax=$uidmax \ -- '$uidfield>=uidmin && $uidfield