projects
/
snf-image-creator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2a79684
)
Fix a bug in get_passworded_users
author
Nikos Skalkotos
<skalkoto@grnet.gr>
Mon, 5 Mar 2012 14:13:05 +0000
(16:13 +0200)
committer
Nikos Skalkotos
<skalkoto@grnet.gr>
Mon, 5 Mar 2012 14:13:05 +0000
(16:13 +0200)
image_creator/os_type/unix.py
patch
|
blob
|
history
diff --git
a/image_creator/os_type/unix.py
b/image_creator/os_type/unix.py
index
2aacd8a
..
e5e5a87
100644
(file)
--- a/
image_creator/os_type/unix.py
+++ b/
image_creator/os_type/unix.py
@@
-19,14
+19,14
@@
class Unix(OSBase):
users = []
regexp = re.compile('(\S+):((?:!\S+)|(?:[^!*]\S+)|):(?:\S*:){6}')
users = []
regexp = re.compile('(\S+):((?:!\S+)|(?:[^!*]\S+)|):(?:\S*:){6}')
- for line in open('/etc/shadow', 'r').readlines():
+ for line in self.g.cat('/etc/shadow').splitlines():
match = regexp.match(line)
if not match:
continue
user, passwd = match.groups()
if len(passwd) > 0 and passwd[0] == '!':
match = regexp.match(line)
if not match:
continue
user, passwd = match.groups()
if len(passwd) > 0 and passwd[0] == '!':
- print "Warning: %s is locked" % user
+ print "Warning: Ignoring locked %s account." % user
else:
users.append(user)
else:
users.append(user)