diff options
-rwxr-xr-x | localnotifypwexp | 6 |
1 files 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<uidmax \ - {print $unamefield}' $passwdfile) + {print $unamefield}') for user in $users; do |