Commit 1ab1c8d3 by Nigel Metheringham

Take SHADOWFILE from existing user object rather than class

parent 75a2b2ba
...@@ -407,8 +407,8 @@ class User(object): ...@@ -407,8 +407,8 @@ class User(object):
return passwd return passwd
else: else:
# Read shadow file for user's encrypted password string # Read shadow file for user's encrypted password string
if os.path.exists(User.SHADOWFILE) and os.access(User.SHADOWFILE, os.R_OK): if os.path.exists(self.SHADOWFILE) and os.access(self.SHADOWFILE, os.R_OK):
for line in open(User.SHADOWFILE).readlines(): for line in open(self.SHADOWFILE).readlines():
if line.startswith('%s:' % self.name): if line.startswith('%s:' % self.name):
passwd = line.split(':')[1] passwd = line.split(':')[1]
return passwd return passwd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment