Revision 36e348b6
b/image_creator/os_type/unix.py | ||
---|---|---|
19 | 19 |
users = [] |
20 | 20 |
regexp = re.compile('(\S+):((?:!\S+)|(?:[^!*]\S+)|):(?:\S*:){6}') |
21 | 21 |
|
22 |
for line in open('/etc/shadow', 'r').readlines():
|
|
22 |
for line in self.g.cat('/etc/shadow').splitlines():
|
|
23 | 23 |
match = regexp.match(line) |
24 | 24 |
if not match: |
25 | 25 |
continue |
26 | 26 |
|
27 | 27 |
user, passwd = match.groups() |
28 | 28 |
if len(passwd) > 0 and passwd[0] == '!': |
29 |
print "Warning: %s is locked" % user
|
|
29 |
print "Warning: Ignoring locked %s account." % user
|
|
30 | 30 |
else: |
31 | 31 |
users.append(user) |
32 | 32 |
|
Also available in: Unified diff