summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-29 13:49:41 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-29 13:49:41 +0200
commita3f6ada361d0942dbe60074d348b9bcf6be83efd (patch)
tree9f7e505b9fb8cc03b76d3a8c781d482dacf2fa2d /pykolab
parent2001494a7dfebe9a1b1bc0e4725b6449cf0ca34f (diff)
downloadpykolab-a3f6ada361d0942dbe60074d348b9bcf6be83efd.tar.gz
If the entry_dn is None, we are chasing referrals - which we do not want.
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/ldap/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 6eda75a..0a564fa 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -361,7 +361,6 @@ class LDAP(pykolab.base.Base):
_filter = "%s%s%s" % (__filter_prefix,_filter,__filter_suffix)
-
log.debug(_("Finding recipient with filter %r") % (_filter), level=8)
if len(_filter) <= 6:
@@ -379,7 +378,10 @@ class LDAP(pykolab.base.Base):
for _result in _results:
(_entry_id, _entry_attrs) = _result
- _entry_dns.append(_entry_id)
+
+ # Prevent Active Directory referrals
+ if not _entry_id == None:
+ _entry_dns.append(_entry_id)
return _entry_dns
@@ -2014,6 +2016,10 @@ class LDAP(pykolab.base.Base):
# Typical for Paged Results Control
elif kw.has_key('entry') and isinstance(kw['entry'], list):
for entry_dn,entry_attrs in kw['entry']:
+ # This is a referral
+ if entry_dn == None:
+ continue
+
entry = { 'dn': entry_dn }
entry_attrs = utils.normalize(entry_attrs)
for attr in entry_attrs.keys():