Wednesday, May 20, 2009

ldap_modify: Operation not allowed on RDN

I was trying to change the value for an attribute "cn" and I encountered the error:

    ldap_modify: Operation not allowed on RDN

A Google search on RDN returns the following:

The relative distinguished name (RDN) is the leftmost element in an entry distinguished name (DN). For example, the RDN for uid=Marcia Garza,ou=People,dc=example,dc=com is uid=Marcia Garza. To change an RDN, use the changetype:moddn LDIF update statement.

So, here we go if we need to change a RDN value:

bash-3.00# ldapmodify -D "cn=Directory Manager" -w 1234
dn: cn=Bronze(50MB/No IMAP),o=mailuser,o=cosTemplates,o=isp
changetype: moddn
newrdn: cn=Bronze[50MB/No IMAP]
deleteoldrdn: 1

modifying RDN of entry cn=Bronze(50MB/No IMAP),o=mailuser,o=cosTemplates,o=isp

The modification takes into effect:

bash-3.00# ldapsearch -D "cn=Directory Manager" -w 1234 -b o=isp "(&(objectclass=ldapsubentry)(cn=Bronze[*))"
version: 1

dn: cn=Bronze[50MB/No IMAP],o=mailuser,o=cosTemplates,o=isp
objectClass: top
objectClass: LDAPsubentry
objectClass: extensibleobject
objectClass: cosTemplate
mailMsgMaxBlocks: 5000
mailQuota: 50M
mailMsgQuota: 10000
mailAllowedServiceAccess: +pop:ALL$+smtp:ALL$+http:ALL
daservicetype: mail user
cn: Bronze[50MB/No IMAP]

No comments:

Post a Comment