For Programmers: Free Programming Magazines  


Home > Archive > LDAP > April 2006 > Submit patch to contrib/ldifdiff.pl









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Submit patch to contrib/ldifdiff.pl
Anthony Milan

2006-04-22, 8:21 am

Hi all,

I have to compare two ldif files and I use the ldifdiff.pl script to do
this. This w, I have this two entries like this :

# new.ldif
dn: cn=Tonio,ou=Washington,dc=company,dc=com

objectclass: inetOrgPerson
cn: Tonio
ou: Washington
sn: Tonio
employeenumber: 888999

# old.ldif
dn: cn=Tony,ou=Los Angeles,dc=company,dc=com
objectclass: inetOrgPerson
cn: Tony
ou: Los Angeles
sn: Tony
employeenumber: 888999

The result of ldifdiff -k employeenumber new.ldif old.ldif was :

dn: cn=Tony,ou=Los Angeles,dc=company,dc=com
changetype: modrdn
newrdn: cn=Tonio
deleteoldrdn: 1

dn: cn=Tonio,ou=Washington,dc=company,dc=com

changetype: modify
replace: ou
ou: Washington
-
replace: sn
sn: Tonio

I think that's wrong the changetype would be moddn and not modrdn.
I propose this patch to do this. The result was :

dn: cn=Tony,ou=Los Angeles,dc=company,dc=com
changetype: moddn
newrdn: cn=Tonio
deleteoldrdn: 1
newsuperior: ou=Washington,dc=company,dc=com

dn: cn=Tonio,ou=Washington,dc=company,dc=com

changetype: modify
replace: ou
ou: Washington
-
replace: sn
sn: Tonio

Hope that helps anyway.

Regards,
--
Anthony Milan

Kartik Subbarao

2006-04-25, 7:26 pm

Anthony Milan wrote:
> Hi all,
>
> I have to compare two ldif files and I use the ldifdiff.pl script to do
> this. This w, I have this two entries like this :

[...]
> I think that's wrong the changetype would be moddn and not modrdn.


You're right. The script did not have support for moddn.

I have checked in an updated version into the SVN repository. Please try
it out and let me know how it works. Also, I fixed a bug that you
reported back in June 2005 (which I didn't see until relatively
recently) with case-sensitive DN comparisons. Sorry for the long delay
on that!

Regards,

-Kartik
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com