mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Import explode_dn from ldap.functions for backward compatibility with older version of python-ldap. Fix bug in add_entry_to_group.
Resolves 510149
This commit is contained in:
parent
45a40635bb
commit
3b613091bb
@ -38,6 +38,8 @@ import ldap.filter as _ldap_filter
|
|||||||
import ldap.sasl as _ldap_sasl
|
import ldap.sasl as _ldap_sasl
|
||||||
from ldap.controls import LDAPControl
|
from ldap.controls import LDAPControl
|
||||||
from ldap.ldapobject import SimpleLDAPObject
|
from ldap.ldapobject import SimpleLDAPObject
|
||||||
|
# for backward compatibility
|
||||||
|
from ldap.functions import explode_dn
|
||||||
|
|
||||||
from ipalib import api, errors
|
from ipalib import api, errors
|
||||||
from ipalib.crud import CrudBackend
|
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
|
Note: You don't have to normalize DN's before passing them to
|
||||||
ldap2 methods. It's done internally for you.
|
ldap2 methods. It's done internally for you.
|
||||||
"""
|
"""
|
||||||
rdns = _ldap.dn.explode_dn(dn)
|
rdns = explode_dn(dn)
|
||||||
if rdns:
|
if rdns:
|
||||||
dn = ','.join(rdns)
|
dn = ','.join(rdns)
|
||||||
if not dn.endswith(self.api.env.basedn):
|
if not dn.endswith(self.api.env.basedn):
|
||||||
@ -577,7 +579,7 @@ class ldap2(CrudBackend, Encoder):
|
|||||||
if dn == group_dn:
|
if dn == group_dn:
|
||||||
raise errors.SameGroupError()
|
raise errors.SameGroupError()
|
||||||
# check if the entry exists
|
# check if the entry exists
|
||||||
(dn, entry_attrs) = self.get_entry(dn, ['objectclass'], [''])
|
(dn, entry_attrs) = self.get_entry(dn, ['objectclass'])
|
||||||
|
|
||||||
# get group entry
|
# get group entry
|
||||||
(group_dn, group_entry_attrs) = self.get_entry(group_dn, [member_attr])
|
(group_dn, group_entry_attrs) = self.get_entry(group_dn, [member_attr])
|
||||||
|
Loading…
Reference in New Issue
Block a user