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

Re: script MySQL ldap DONE, and some questions




Manuel Mely wrote:

> dn: cn=Francisco Javier Otero Manresa,ou=Mathisa,o=minbas,c=cu
> objectclass: top
> objectclass: inetOrgPerson
> cn: Francisco Javier
> sn: Otero Manresa
> ou: Mathisa
> mail: admin@mathisa.minbas.cu <mailto:admin@mathisa.minbas.cu>

> dn: cn=Francisco Javier Otero Manresa,ou=Mathisa,o=minbas,c=cu
> objectclass: top
> objectclass: inetOrgPerson
> cn: Francisco Javier
> sn: Otero Manresa
> ou: Emp. de Materiales Higienicos Sanitarios MATHISA
> mail: francisco@mathisa.minbas.cu <mailto:francisco@mathisa.minbas.cu>

> As all can see i have the same CN and i want to add the 2 entries
> What to do?

Francisco is Francisco, he is just one person, there is only one
Francisco Javier Otero Manresa in Mathisa, so there should only
be one entry for him in ldap. What you do in ldap is this:

dn: cn=Francisco Javier Otero Manresa,ou=Mathisa,o=minbas,c=cu
objectclass: top
objectclass: inetOrgPerson
cn: Francisco Javier
sn: Otero Manresa
ou: Emp. de Materiales Higienicos Sanitarios MATHISA
mail: francisco@mathisa.minbas.cu
mail: admin@mathisa.minbas.cu

As for the perl scripts, you will have to do something like

if (dn exists in ldap) {
  fetch all its attributes
  compare the existing attributes to the submitted entry
  add or delete attributes as needed
} else {
  add the submitted entry to ldap as is
}


> When i add an ldif to the ldap server where does ldapadd put the entries? > a file?

That depends on your 'database' definition in slapd.conf.
Most common is ldbm and then the data go into (approximately)
as many files as you have defined indices in slapd.conf .
They could go into a "real" database though. If you are
using redhat, do 'ls -l /var/lib/ldap/' .

Z