mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Protect password
This commit is contained in:
parent
536b46e527
commit
ca91a9cae5
1 changed files with 6 additions and 3 deletions
|
@ -185,9 +185,12 @@ class LoggerPasswordValidator(ProfilePasswordValidator):
|
|||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 2:
|
||||
print("usage: password.py PASSWORD")
|
||||
|
||||
status, msg = ProfilePasswordValidator('user').validate(sys.argv[1])
|
||||
import getpass
|
||||
pwd = getpass.getpass("")
|
||||
#print("usage: password.py PASSWORD")
|
||||
else:
|
||||
pwd = sys.argv[1]
|
||||
status, msg = ProfilePasswordValidator('user').validate(pwd)
|
||||
if status == "error":
|
||||
sys.exit(msg)
|
||||
elif status == "warning":
|
||||
|
|
Loading…
Add table
Reference in a new issue