summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2009-07-08 17:11:02 +0200
committerRob Crittenden <rcritten@redhat.com>2009-07-08 12:15:58 -0400
commit3b613091bbc952e03ae73640311a8136f40a95ff (patch)
treed51c62d4bafdbf0da7b34930e5cba4aa2153bf33 /ipaserver
parent45a40635bb6867f55f757413776c2374ae07a888 (diff)
downloadfreeipa-3b613091bbc952e03ae73640311a8136f40a95ff.tar.gz
freeipa-3b613091bbc952e03ae73640311a8136f40a95ff.tar.xz
freeipa-3b613091bbc952e03ae73640311a8136f40a95ff.zip
Import explode_dn from ldap.functions for backward compatibility with older version of python-ldap. Fix bug in add_entry_to_group.
Resolves 510149
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/plugins/ldap2.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py
index 43cc6b976..a904afaa1 100644
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -38,6 +38,8 @@ import ldap.filter as _ldap_filter
import ldap.sasl as _ldap_sasl
from ldap.controls import LDAPControl
from ldap.ldapobject import SimpleLDAPObject
+# for backward compatibility
+from ldap.functions import explode_dn
from ipalib import api, errors
from ipalib.crud import CrudBackend
@@ -235,7 +237,7 @@ class ldap2(CrudBackend, Encoder):
Note: You don't have to normalize DN's before passing them to
ldap2 methods. It's done internally for you.
"""
- rdns = _ldap.dn.explode_dn(dn)
+ rdns = explode_dn(dn)
if rdns:
dn = ','.join(rdns)
if not dn.endswith(self.api.env.basedn):
@@ -577,7 +579,7 @@ class ldap2(CrudBackend, Encoder):
if dn == group_dn:
raise errors.SameGroupError()
# check if the entry exists
- (dn, entry_attrs) = self.get_entry(dn, ['objectclass'], [''])
+ (dn, entry_attrs) = self.get_entry(dn, ['objectclass'])
# get group entry
(group_dn, group_entry_attrs) = self.get_entry(group_dn, [member_attr])