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

Re: [openldap-technical] OpenLDAP custom schema [dummy question]



Alexandru Ocheana wrote:
> objectclass (
>        1.3.6.1.4.1.49565.1.2.1
>        NAME 'infoVCard'
>        DESC 'Extra Information Card'
>        AUXILIARY )
         ^^^^^^^^^
> dn: uid=alex,ou=People,dc=info,dc=uaic,dc=ro
> objectClass: inetOrgPerson
> objectClass: posixAccount
> objectClass: shadowAccount
> cn: Alexandru
> sn: Ocheana
> userPassword: {SSHA}BBxUpzvO93HlFEFPSkexvXA7G06UBYO4
> loginShell: /bin/bash
> uidNumber: 2000
> gidNumber: 2000
> homeDirectory: /home/alex
> 
> ## -------------------------
> ## HERE I BELIEVE IS AN ERROR BUT WHICH IS THE CORRECT WAY TO ADD IT?
> ## THIS PART IS TO ADD DATA TO THAT NEW SCHEMA
> ## -------------------------
> dn: uid=alex,ou=People,dc=info,dc=uaic,dc=ro
> objectClass: infoVCard
> cnp: myCNP
> emailContact: otheremail@gmail.com
> [..]
> adding new entry "uid=alex,ou=People,dc=info,dc=uaic,dc=ro"
> ldap_add: Object class violation (65)
>     additional info: no structural object class provided

The error message is pretty clear. Your "second" entry record does not have any
STRUCTURAL object class.

You're defining two LDIF entry records with same DN which represent two distinct entries.

You either want to simple merge both to one entry record or learn how LDIF *change*
records are defined (see RFC 2849).

Combined single entry record (to be used with ldapadd tool):

-------------------------------------------------
dn: uid=alex,ou=People,dc=info,dc=uaic,dc=ro
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
objectClass: infoVCard
cn: Alexandru
sn: Ocheana
userPassword: {SSHA}BBxUpzvO93HlFEFPSkexvXA7G06UBYO4
loginShell: /bin/bash
uidNumber: 2000
gidNumber: 2000
homeDirectory: /home/alex
cnp: myCNP
emailContact: otheremail@gmail.com

-------------------------------------------------

Or two separate change records (add and modify) for one add operation and a subsequent
modify operation (to be used with ldapmodify tool):

-------------------------------------------------
dn: uid=alex,ou=People,dc=info,dc=uaic,dc=ro
changetype: add
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
cn: Alexandru
sn: Ocheana
userPassword: {SSHA}BBxUpzvO93HlFEFPSkexvXA7G06UBYO4
loginShell: /bin/bash
uidNumber: 2000
gidNumber: 2000
homeDirectory: /home/alex

dn: uid=alex,ou=People,dc=info,dc=uaic,dc=ro
changetype: modify
add: objectClass
objectClass: infoVCard
-
add: cnp
cnp: myCNP
-
add: emailContact
emailContact: otheremail@gmail.com
-

-------------------------------------------------

But really: Look at RFC 2849 to understand the details within the example above!

Ciao, Michael.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature