Only allow 3 password attempts

pull/5/head
David Bartley 15 years ago
parent 40cf5ec2f3
commit c22b6e91a3
  1. 4
      ceo/members.py
  2. 1
      ceo/urwid/main.py

@ -90,11 +90,15 @@ def connect(auth_callback):
global ld
password = None
tries = 0
while ld is None:
try:
ld = ldapi.connect_sasl(cfg['server_url'], cfg['sasl_mech'],
cfg['sasl_realm'], password)
except ldap.LOCAL_ERROR, e:
tries += 1
if tries > 3:
raise e
password = auth_callback.callback(e)
if password == None:
raise e

@ -156,7 +156,6 @@ def start():
ui.run_wrapper( run )
except ldap.LOCAL_ERROR, e:
print ldapi.format_ldaperror(e)
print "Hint: You may need to run 'kinit'"
except ldap.INSUFFICIENT_ACCESS, e:
print ldapi.format_ldaperror(e)
print "You probably aren't permitted to do whatever you just tried."

Loading…
Cancel
Save