mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-22 02:17:26 +00:00
Merge pull request #366 from hnk/hnk-patch-read_password
Change read_password() logic to catch short passwords
This commit is contained in:
commit
f4fa9c93a0
@ -28,13 +28,17 @@ def mgmt(cmd, data=None, is_json=False):
|
|||||||
return resp
|
return resp
|
||||||
|
|
||||||
def read_password():
|
def read_password():
|
||||||
first = getpass.getpass('password: ')
|
while True:
|
||||||
second = getpass.getpass(' (again): ')
|
first = getpass.getpass('password: ')
|
||||||
while first != second:
|
if len(first) < 4:
|
||||||
print('Passwords not the same. Try again.')
|
print('Passwords must be at least four characters.')
|
||||||
first = getpass.getpass('password: ')
|
continue
|
||||||
second = getpass.getpass(' (again): ')
|
second = getpass.getpass(' (again): ')
|
||||||
return first
|
if first != second:
|
||||||
|
print('Passwords not the same. Try again.')
|
||||||
|
continue
|
||||||
|
break
|
||||||
|
return first
|
||||||
|
|
||||||
def setup_key_auth(mgmt_uri):
|
def setup_key_auth(mgmt_uri):
|
||||||
key = open('/var/lib/mailinabox/api.key').read().strip()
|
key = open('/var/lib/mailinabox/api.key').read().strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user