Jemson
Jemson

Reputation: 45

OpenLDAP Custom Attribute: "Undefined attribute type"

Attempting to add a new attribute to OpenLDAP and keep hitting brick walls. I am trying to add an ipPhone attribute to the schema since I can't include * numbers in the default telephoneNumber attribute.

My LDIF file used to create the new attribute and like it to the objectClass is below.

dn: cn=schema,cn=config
changetype: modify
add: olcAttributeTypes
olcAttributeTypes: ( 2.25.128424792425578037463837247958458780603.1
        NAME 'ipPhone'
        DESC 'Extension Number'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
-
add: olcObjectClasses
olcObjectClasses: ( 2.25.128424792425578037463837247958458780603.3
    NAME 'samplePerson'
    DESC 'samplePerson'
    SUP inetOrgPerson
    STRUCTURAL
    MAY  (ipPhone)
 )

To apply the above, I used:

ldapmodify -Y EXTERNAL -H ldapi:/// -f attrib.ldif

I can see the added config in: /etc/ldap/slapd.d/cn=config/cn=schema.ldif

However, after restarting slapd and attempting to add a new user with this attribute, I return the error:

ldap.UNDEFINED_TYPE: {'info': u'ipPhone: attribute type undefined', 'desc': u'Undefined attribute type'}

I have been testing and googling for hours but have been unable to resolve this or figure out what I have missed!

Upvotes: 0

Views: 5028

Answers (1)

Jemson
Jemson

Reputation: 45

Turns out I didn't have the objectClass assigned to the users.

Upvotes: 0

Related Questions