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:44:43 +0200
commit744c3f038b4befea35e4dad67acb0a42d1a10dd1 (patch)
tree248fe41785ce5bc384c1b0fa9b7ef72341bf47ab
parentf1351a4c2485a9be8f0a524e63652addcb385a5d (diff)
downloadpykolab-744c3f038b4befea35e4dad67acb0a42d1a10dd1.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 1c41924..97ff4df 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1185,6 +1185,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)
@@ -1316,6 +1319,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):