summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-31 19:25:04 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-31 19:25:04 (GMT)
commitc632938b0ce07d8d7e15585424573ae4a8f10d9f (patch)
treed6d77bc482b14fec6bd958485ae3543edb9fe82b
parent264e5351ef719d78c6b487483748283801db53ce (diff)
downloadpykolab-c632938b0ce07d8d7e15585424573ae4a8f10d9f.tar.gz
Catch LDAP errors
-rw-r--r--saslauthd/__init__.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/saslauthd/__init__.py b/saslauthd/__init__.py
index f04a232..4eaba67 100644
--- a/saslauthd/__init__.py
+++ b/saslauthd/__init__.py
@@ -194,7 +194,14 @@ class SASLAuthDaemon(object):
auth = Auth(domain=realm)
auth.connect()
- if auth.authenticate(login):
+ success = False
+
+ try:
+ success = auth.authenticate(login)
+ except:
+ success = False
+
+ if success:
# #1170: Catch broken pipe error (incomplete authentication request)
try:
clientsocket.send(struct.pack("!H2s", 2, "OK"))