[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: problem with moddn



John Von Essen wrote:

I have data in OpenLDAP like this:

dn: uid=ejones,ou=trad,ou=students,ou=people,o=domain.com
cn: Ed Jones
givenName: Ed
sn: Jones
and so on...

I want to change the ou's in the DN.

dn: uid=ejones,ou=trad,ou=students,ou=people,o=domain.com

gets changed to

dn: uid=ejones,ou=faculty,ou=people,o=domain.com

I created the following ldif file and executed ldapmodify -D "XXX" -w XXX -x -v -f file.ldif

dn: uid=ejones,ou=trad,ou=students,ou=people,o=domain.com
changetype: moddn
newrdn: uid=ejones,ou=faculty,ou=people,o=domain.com

I get the error:
ldap_initialize( <DEFAULT> )
modifying rdn of entry "uid=ejones,ou=trad,ou=students,ou=people,o=domain.com"
new RDN: "uid=ejones,ou=Staff,ou=People,o=eastern.edu " (do not keep existing values)
modrdn completed
ldap_rename: Invalid DN syntax (34)
additional info: invalid new RDN


I have tried changing newrdn to newdn?! But that just causes more errors:
ldap_initialize( <DEFAULT> )
ldapmodify: expecting "newrdn:" but saw "newdn:" (line 3 of entry "uid=ejones,ou=trad,ou=students,ou=people,o=domain.com")


Could someone point me in the right direction here? Thanks
-John
Use ldapmodrdn instead?

"newrdn" means what it says - the value is supposed to be an RDN. You can't put a full DN in there. You want "newSuperior" for your purpose.
--
-- Howard Chu
Chief Architect, Symas Corp. Director, Highland Sun
http://www.symas.com http://highlandsun.com/hyc
Symas: Premier OpenSource Development and Support