Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 10-24-2012, 07:47 AM   #1
LQ Newbie
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
OpenLDAP - correct invalid cn entries

A bug in a PHP script has caused some entries in the LDAP database to have invalid entries:
# James + Bond, people,
dn: cn=James+sn=Bond,ou=people,dc=mi6,dc=gov,dc=uk
sn: Bond
givenName: James
cn:: U3RldmUg
gecos:: U3RldmUg
As you can see, the cn: and gecos: have the invalid entries - they should be James Bond.

I did attempt to correct the problem with ldapmodify by putting the following into a file called updateCN.ldif:
dn: cn=James+sn=Bond,ou=people,dc=mi6,dc=gov,dc=uk
replace: cn
cn: James Bond
and executing the following command:
ldapmodify -x -W -D "cn=admin,dc=mi6,dc=gov,dc=uk" -f updateCN.ldif
This returned the following error
Enter LDAP Password:
modifying entry "cn=James+sn=Bond,ou=people,dc=mi6,dc=gov,dc=uk"
ldap_modify: Naming violation (64)
additional info: value of naming attribute 'cn' is not present in entry
How can I correct the invalid entries in the LDAP database?
Old 10-25-2012, 04:58 PM   #2
Registered: Oct 2006
Posts: 300

Rep: Reputation: 32
I can't check but cn and dn are special attributes.
You can get information in command ldapmodrdn
man ldapmodrdn
There you can find an example:
Assuming that the file /tmp/entrymods exists and has the contents:

cn=Modify Me,dc=example,dc=com
cn=The New Me

the command:

ldapmodrdn -r -f /tmp/entrymods

will change the RDN of the "Modify Me" entry from "Modify Me" to "The New Me" and the old cn, "Modify Me" will be removed.

Last edited by Felipe; 10-25-2012 at 04:59 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] openldap ldap_bind: Invalid credentials (49) sanjaydelhi Linux - Newbie 9 03-16-2011 09:29 AM
OpenLDAP runs OK, Mac Mail and Address book do not display entries. Toomas Linux - Server 0 11-27-2010 01:37 AM
[SOLVED] openldap setup Invalid credentials error (49) vigilandy Linux - Server 9 10-15-2010 09:33 AM
OpenLDAP - no entries listed swilliams2006 Linux - Server 1 05-26-2009 04:30 PM
ldap_bind: Invalid credentials (49) on OpenLDAP server gergaholic Linux - Server 7 11-08-2007 09:03 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration