Take SHADOWFILE from existing user object rather than class
This commit is contained in:
parent
ed5bf78485
commit
c6c7189e23
1 changed files with 2 additions and 2 deletions
4
user
4
user
|
@ -407,8 +407,8 @@ class User(object):
|
|||
return passwd
|
||||
else:
|
||||
# Read shadow file for user's encrypted password string
|
||||
if os.path.exists(User.SHADOWFILE) and os.access(User.SHADOWFILE, os.R_OK):
|
||||
for line in open(User.SHADOWFILE).readlines():
|
||||
if os.path.exists(self.SHADOWFILE) and os.access(self.SHADOWFILE, os.R_OK):
|
||||
for line in open(self.SHADOWFILE).readlines():
|
||||
if line.startswith('%s:' % self.name):
|
||||
passwd = line.split(':')[1]
|
||||
return passwd
|
||||
|
|
Loading…
Reference in a new issue