I am using ldapadd and I want to add an attribute type to the repository so it can be used by other entries.
I'm having a few issues. Here is my ldif file.
dn: dc=myorg,dc=co,dc=uk
changetype: add
add: attributetypes
attributetype: ( 2.2.980.1.1 NAME ( 'ecdvisibility' 'ecdvis' ) DESC 'The visibility of the object' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE USAGE userApplications )
After checking the lines for spaces at the end, I see that everything is OK:
dn: dc=myorg,dc=co,dc=uk$
changetype: add$
add: attributetypes$
attributetype: ( 2.2.980.1.1 NAME ( 'ecdvisibility' 'ecdvis' )$
DESC 'The visibility of the object'$
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15$
SINGLE-VALUE$
USAGE userApplications )$
what I see is a mysterious error like the following:
ldap_add: Undefined attribute type (17)
additional info: add: attribute type undefined
I don't understand this error, the attribute type is not defined, I'm trying to add it! Also just before that line it says:
adding new entry "dc=myorg,dc=co,dc=uk"
Why is it adding this, it already exists. I'm also not sure whether I should be using ldapadd or ldapmodify.
My typical command is:
sudo ldapadd -D cn=admin,dc=myorg,dc=co,dc=uk -w password -v -f attributeType.ldif
I also made sure there is a trialling blank line at the end of the file, although that seems to make no difference at all.
What is the best way to add such an attribute that can be used by any user?
Update
I've also tried the following:
dn: cn=schema
changetype: modify
add: attributeTypes
##
## The new attribute type
##
attributeTypes: ( ecdvisibility.oid NAME ( 'ecdvisibility' 'ecdvis' ) DESC 'The visibility of the object' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE USAGE userApplications )
But this time I get this error:
ldap_modify: Invalid syntax (21)
additional info: attributeTypes: value #0 invalid per syntax