summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/ipaldap.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2007-11-12 23:11:55 -0500
committerRob Crittenden <rcritten@redhat.com>2007-11-12 23:11:55 -0500
commitcd489f0a73bcdb2583a5f69defb08ea45278c05a (patch)
treeb516d7c8a22ce10ae04dde73ab78c1368303f2de /ipa-server/ipaserver/ipaldap.py
parent99b84bfd01e0b3f4e9e69ea7c2912545bef0d71a (diff)
downloadfreeipa.git-cd489f0a73bcdb2583a5f69defb08ea45278c05a.tar.gz
freeipa.git-cd489f0a73bcdb2583a5f69defb08ea45278c05a.tar.xz
freeipa.git-cd489f0a73bcdb2583a5f69defb08ea45278c05a.zip
Allow a user or group to change an attribute in its RDN
Add secretary to the list of indexes otherwise RDN changing could be slow Port --addattr, --setattr and --delattr from usermod to groupmod
Diffstat (limited to 'ipa-server/ipaserver/ipaldap.py')
-rw-r--r--ipa-server/ipaserver/ipaldap.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/ipaldap.py b/ipa-server/ipaserver/ipaldap.py
index 69f040eb..d319869d 100644
--- a/ipa-server/ipaserver/ipaldap.py
+++ b/ipa-server/ipaserver/ipaldap.py
@@ -377,6 +377,23 @@ class IPAdmin(SimpleLDAPObject):
raise ipaerror.gen_exception(ipaerror.LDAP_DATABASE_ERROR, None, e)
return "Success"
+ def updateRDN(self, dn, newrdn):
+ """Wrap the modrdn function."""
+
+ sctrl = self.__get_server_controls__()
+
+ if dn == newrdn:
+ # no need to report an error
+ return "Success"
+
+ try:
+ if sctrl is not None:
+ self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl)
+ self.modrdn_s(dn, newrdn, delold=1)
+ except ldap.LDAPError, e:
+ raise ipaerror.gen_exception(ipaerror.LDAP_DATABASE_ERROR, None, e)
+ return "Success"
+
def updateEntry(self,dn,olduser,newuser):
"""This wraps the mod function. It assumes that the entry is already
populated with all of the desired objectclasses and attributes"""