[olug] Ldap error on ldapadd

Tim Bornholtz tim at bornholtz.com
Wed Dec 10 14:30:47 UTC 2003


Eric Penne wrote:

>I'm trying to run this command:
>
>ldapadd -x -D "cn=admin,dc=thepennes,dc=net" -W -f /var/www/rolodap/extras/
>sample.ldif
>
>I get this output:
>
>adding new entry "dc=thepennes, dc=net"
>ldapadd: update failed: dc=thepennes, dc=net
>ldap_add: Object class violation (65)
>        additional info: object class 'organization' requires attribute 'o'
>
>I've attached the sample.ldif file below.  I thought since I was using the 
>dc=thepennes,dc=net that I didn't need an "o" value.  If I do need "o" where 
>do I define it?  
>
>Thanks
>Eric
>
>
>  
>
The schema definition for organization is this:

objectclass ( 2.5.6.4 NAME 'organization'
        DESC 'RFC2256: an organization'
        SUP top STRUCTURAL
        MUST o
        MAY ( userPassword $ searchG... (lots of optional attributes)

So every time you add an "objectclass: organization" it most have an 
o=something.


>sample.ldif
>*********************************
>dn: dc=thepennes, dc=net
>objectclass: top
>objectclass: organization
>dc: thepennes
>
>  
>
<snip/>

I'm not 100% sure on this since all of my top level structures are 
o=something not dc=something.

Will this work? (pure guess just from looking at the schema)

dn: dc=thepennes, dc=net
objectclass: top
objectclass: dcObject
dc: thepennes


Or this is how I've typically done it:

dn: o=thepennes.net
dc: thepennes   # This might be incorrect to put here
objectclass: dcObject
objectclass: organization
o: thepennes.net

-Tim


More information about the OLUG mailing list