LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-24-2012, 07:47 AM   #1
wjc951
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, mi6.gov.uk
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
changetype:modify
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
Felipe
Member
 
Registered: Oct 2006
Posts: 302

Rep: Reputation: 32
Hello:
I can't check but cn and dn are special attributes.
You can get information in command ldapmodrdn
Quote:
man ldapmodrdn
There you can find an example:
Quote:
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:31 AM.

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