Skip to content

Commit 308e0df

Browse files
committed
WIP
1 parent cd14ee0 commit 308e0df

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pyinfra/facts/server.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,8 @@ class Users(FactBase):
478478

479479
def command(self):
480480
return """
481-
482-
for i in `cat /etc/passwd | cut -d: -f1`; do
483-
ENTRY=`grep ^$i: /etc/passwd`;
481+
for i in `getent passwd | cut -d: -f1`; do
482+
ENTRY=`grep ^$i: $(getent passwd)`;
484483
LASTLOG_RAW=`(lastlog -u $i 2> /dev/null || lastlogin $i 2> /dev/null)`;
485484
LASTLOG=`echo $LASTLOG_RAW | grep ^$i | tr -s ' '`;
486485
PASSWORD=`grep ^$i: /etc/shadow | cut -d: -f2`;

0 commit comments

Comments
 (0)