summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2013-07-24 21:59:49 +0200
committerMartin Kosek <mkosek@redhat.com>2013-07-26 13:38:37 +0200
commit22681013b27a66b90f3fc4ac2cf5ff8587f0c478 (patch)
treed5167cbae5437edc2891827e6ae300f1f11546ae /ipapython
parent04839a2aead91fe1e174c7e4dc33c424cee7a87d (diff)
downloadfreeipa-22681013b27a66b90f3fc4ac2cf5ff8587f0c478.tar.gz
freeipa-22681013b27a66b90f3fc4ac2cf5ff8587f0c478.tar.xz
freeipa-22681013b27a66b90f3fc4ac2cf5ff8587f0c478.zip
Skip referrals when converting LDAP result to LDAPEntry
When converting the result obtained by python-ldap library, we need to skip unresolved referral entries, since they cannot be converted. https://fedorahosted.org/freeipa/ticket/3814
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipaldap.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index 2a55b7be7..b6a5305a3 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -425,6 +425,15 @@ class IPASimpleLDAPObject(object):
original_dn = dn_tuple[0]
original_attrs = dn_tuple[1]
+ # original_dn is None if referral instead of an entry was
+ # returned from the LDAP server, we need to skip this item
+ if original_dn is None:
+ log_msg = 'Referral entry ignored: {ref}'\
+ .format(ref=str(original_attrs))
+ self.log.debug(log_msg)
+
+ continue
+
ipa_entry = LDAPEntry(self, DN(original_dn))
for attr, original_values in original_attrs.items():