summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-16 19:44:43 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-16 19:48:39 +0200
commit3a209a1668221e4e2cba904e26eee991a3bf021a (patch)
tree71df19eb933cd1452f8a422e2a66fd9ac0f26c75
parentff1aa0f1e2fa7cd7c33eb5d7f046f548da9e69da (diff)
downloadpykolab-3a209a1668221e4e2cba904e26eee991a3bf021a.tar.gz
Make sure a non-existent result attribute value does not result in an attempt to create a mailbox
-rw-r--r--pykolab/auth/ldap/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index d1c2642..5037709 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1088,6 +1088,9 @@ class LDAP(pykolab.base.Base):
if entry[result_attribute] == None:
return
+ if entry[result_attribute] == '':
+ return
+
cache.get_entry(self.domain, entry)
self.imap.connect(domain=self.domain)
@@ -1220,6 +1223,15 @@ class LDAP(pykolab.base.Base):
for key in entry_changes.keys():
entry[key] = entry_changes[key]
+ if not entry.has_key(result_attribute):
+ return
+
+ if entry[result_attribute] == None:
+ return
+
+ if entry[result_attribute] == '':
+ return
+
# Now look at entry_changes and old_canon_attr, and see if they're
# the same value.
if entry_changes.has_key(result_attribute):