Fix in unix.py
This commit is contained in:
parent
023ae57225
commit
6318ece7e1
1 changed files with 2 additions and 2 deletions
|
|
@ -56,11 +56,11 @@ def change_password(user, new_password):
|
||||||
try:
|
try:
|
||||||
user_pwd=pwd.getpwnam(user)
|
user_pwd=pwd.getpwnam(user)
|
||||||
|
|
||||||
if call("sudo echo \"%s:%s\" | chpasswd" % (user, new_password), shell=True, stdout=DEVNULL) > 0:
|
if call("sudo echo \"%s:%s\" | sudo chpasswd" % (user, new_password), shell=True, stdout=DEVNULL) > 0:
|
||||||
|
|
||||||
return (True, 'Change password successfully')
|
return (True, 'Change password successfully')
|
||||||
else:
|
else:
|
||||||
return (False, 'I cannot change password')
|
return (False, 'I cannot change password, permissions?')
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue