Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'd like to add custom attributes in OpenLDAP but I maybe do not understand the concept. What I've done was:

I created the custom.schema

attributetype ( 1.3.6.1.4.1.4203.666.100.122
        NAME ( 'dateOfBirth' )
        SUP name
        )

attributetype ( 1.3.6.1.4.1.4203.666.100.123
        NAME ( 'IPPhone' )
        SUP name
        )

objectclass     ( 1.3.6.1.4.1.4203.666.100.1
    NAME 'customAttributes'
        DESC 'Custom attributes class'
    )

I added to slapd.conf

include         /usr/local/etc/openldap/schema/custom.schema

And now I'd like to assign this object class to every uid I have in the current database. So I dumped the db, added objectclass atribute to some uid, and while importing the LDIF, ldap says:

65) invalid structural object class chain (inetOrgPerson/customAttributes)

The LDIF entry is like this:

dn: dc=sss,dc=com
objectClass: top
objectClass: dcObject
objectClass: organization
o: sss.com
dc: sss
structuralObjectClass: organization

dn: ou=People,dc=sss,dc=com
objectClass: organizationalUnit
ou: People
structuralObjectClass: organizationalUnit


dn: uid=zzz,ou=People,dc=sss,dc=com
objectClass: posixAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: customAttributes
structuralObjectClass: inetOrgPerson
...

Could you please navigate me how can I add those custom attributes ?

share|improve this question
    
Check to ensure you do not have two structural object classes. –  Terry Gardner Oct 25 '11 at 16:16

3 Answers 3

up vote 5 down vote accepted

It appears from the invalid structural object class chain error that there is a violation of the STRUCTURAL objectClass rule. Without declaration to the contrary your customAttributes objectClass is being seen as a STRUCTURAL objectClass which it can't be and still work along with inetOrgPerson. I would recommend try changing your schema to something along the lines of the following:

objectclass     ( 1.3.6.1.4.1.4203.666.100.1
    NAME 'customAttributes'
    AUXILIARY
    DESC 'Custom attributes class'
    MAY (dateofBirth $ IPPhone)
)

For a further explanation I'd read over common causes of errors in the LDAP Guide. Beyond that a cursory look of the schema you are trying to create could use some more thought into organization. Usually advisable to have objectClass entities under one tree and attributeType entities under another to avoid confusion and collision.

share|improve this answer
    
I found out it earlier, but however thanks! –  John Oct 25 '11 at 16:35

your new objectclass needs to reference the new attributes. Usually done as a MAY clause

objectclass     ( 1.3.6.1.4.1.4203.666.100.1
    NAME 'customAttributes'
    DESC 'Custom attributes class'
    MAY (dateofBirth $ IPPhone)
)

There may be other requirements. The OpenLDAP admin guide is the best place to start. here is the Class info

share|improve this answer
    
This is not the problem. It seems that the schema is somehow not recognized at all :( –  John Oct 25 '11 at 14:38

Did you modify the schema according to the posts above? And, in addition, ìs the .schema file readable and has the correct permissions?

Does the syslog (or log file of the slapd) give any errors when restarting?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.