I would like to create my own schema in OpenLDAP 2.4.57. Here's the code (I changed the real name of schema and attributes)
dn: cn=myschema,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: myschema
olcAttributeTypes: ( 2.25.1234567.1
NAME 'field1'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
olcAttributeTypes: ( 2.25.1234567.2
NAME 'field2'
EQUALITY octetStringMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
olcObjectClasses: ( 2.25.1234567.3
NAME 'myOwnFields'
SUP top
AUXILIARY
MAY ( field1 $ field2 ) )
I tried to add this schema with the command (ldap response below) :
$ ldapadd -x -D cn=admin,cn=config -w password -H ldap://ldap-server -f myschema.ldif
adding new entry "cn=myschema,cn=schema,cn=config"
When I tried to check if the schema is correctly added to LDAP, OpenLDAP does not answer me it exists :
$ ldapsearch -x -D cn=admin,cn=config -w config -H ldap://ldap-server -b cn=schema,cn=config "(cn=myschema)"
# extended LDIF
#
# LDAPv3
# base <cn=schema,cn=config> with scope subtree
# filter: (cn=myschema)
# requesting: ALL
#
# search result
search: 2
result: 0 Success
# numResponses: 1
What's wrong ?
Some precisions : the password is good, URL of LDAP too. When I search a user in the LDAP, I got the response I expect.
Thanks in advance