Commit f4fa9c93 authored by Joshua Tauberer's avatar Joshua Tauberer

Merge pull request #366 from hnk/hnk-patch-read_password

Change read_password() logic to catch short passwords
parents 3d21f222 6c64723d
......@@ -28,13 +28,17 @@ def mgmt(cmd, data=None, is_json=False):
return resp
def read_password():
first = getpass.getpass('password: ')
second = getpass.getpass(' (again): ')
while first != second:
print('Passwords not the same. Try again.')
first = getpass.getpass('password: ')
second = getpass.getpass(' (again): ')
return first
while True:
first = getpass.getpass('password: ')
if len(first) < 4:
print('Passwords must be at least four characters.')
continue
second = getpass.getpass(' (again): ')
if first != second:
print('Passwords not the same. Try again.')
continue
break
return first
def setup_key_auth(mgmt_uri):
key = open('/var/lib/mailinabox/api.key').read().strip()
......
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