Adding a custom LDAP schema to a Mac OS 10.5.2 server

I have an XServe running Mac OS 10.5.2 and configured as an Open Directory master with the base DN dc=myserver,dc=com. I am trying to add a custom LDAP schema file on this server using the steps outlined below:

1. Copied a file called Custom.schema to /etc/openldap/schema.
2. Added the line *include /etc/openldap/schema/Custom.schema* at the bottom of the file /etc/openldap/slapd.conf.
3. Stopped LDAP server using *sudo slapconfig -stopldapserver*.
4. Started LDAP server using *sudo slapconfig -startldapserver*.

After this, when I try to add data to the custom schema as *sudo ldapadd "myattribute=somevalue,dc=myserver,dc=com" -U diradmin -W -Y CRAM-MD5*, I always get the following error message:

--------------------------------------------------------------------------------
ldap_add: Invalid DN syntax (34)
additional info: invalid DN
--------------------------------------------------------------------------------

This leads me to believe that Open Directory is not picking up the newly added schema file.

Interestingly, the same steps work with the following configurations:

1. Mac OS 10.4.10 with Open Directory in standalone mode.
2. Mac OS 10.4.10 with Open Directory in master mode.
3. Mac OS 10.4.10 with Open Directory in replica mode.
4. Mac OS 10.5.2 with Open Directory in standalone mode.

I am unable to understand why the process works when Open Directory is configured in standalone mode but does not when it is configured as a master.

XServe, Mac OS X (10.5.2)

Posted on May 18, 2008 11:14 PM

Reply
8 replies

May 23, 2008 12:42 PM in response to agrieveduser

This one is driving me crazy as well.

Turns out under the latest version of OpenLDAP the schema definitions are stored in the directory
under a separate branch "cn=config" not "dc=blah,dc=com". The problem I'm having is that the schema branch (cn=schema,cn=config) appears to be locked (possibly by an ACL) and I can't import my custom schema into it.

I've been using ldapbrowser to modify LDAP but it wont let me import my schema description.
I had to do it manually on the command line with ldapadd. (ldapadd -x -H ldap://<LDAP_SERVER>/ -D "cn=config" -W -f <SCHEMA>.ldif.

I was able to import the schema into the root cn=config but not under cn=schema,cn=config. Was working until I rebooted the server now it does not recognize my schema anymore.

Here's a little sample of my schema deffs:

dn: cn={10}DUAConfigProfile, cn=schema, cn=config
olcObjectClasses: {0}( 1.3.6.1.4.1.11.1.3.1.2.5 NAME 'DUAConfigProfile'
SUP top STRUCTURALDESC 'Abstraction of a base configuration for a DUA'
MUST ( cn )MAY ( defaultServerList $ preferredServerList $ defaultSearchBase $ default
SearchScope $ searchTimeLimit $ bindTimeLimit $ credentialLevel $
authenticationMethod $ followReferrals $ dereferenceAliases $ serviceSearchDescriptor
$ serviceCredentialLevel $ serviceAuthenticationMethod $ objectclassMap $
attributeMap $ profileTTL ) )
olcAttributeTypes: {0}( 1.3.6.1.4.1.11.1.3.1.1.0 NAME 'defaultServerList'
DESC 'Default LDAP server host address used by a DUA'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
olcAttributeTypes: {1}( 1.3.6.1.4.1.11.1.3.1.1.1 NAME 'defaultSearchBase'
DESC 'Default LDAP base DN used by a DUA'
EQUALITY distinguishedNameMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
objectClass: olcSchemaConfig
cn: {10}DUAConfigProfile

May 29, 2008 11:28 PM in response to agrieveduser

I spent three days reading the OpenLDAP documentation and figured out that I had to upload the custom schema using a set of LDIF files to the new 'config' backend introduced with OpenLDAP 2.3.

However, even after trying in many different ways to upload the schema, I was unable to have the server understand the new schema. For example, I tried uploading the schema into the server and then tried importing new entries matching the custom schema. Schema uploaded fine but the entries would not load.

Having spent a week and a half on this problem I have given up. I have custom-compiled OpenLDAP from source and have started using it with the legacy configuration layout. I had to resort to this step since I am working against a tight deadline.

Jun 12, 2008 10:13 AM in response to soulsurf

I get the following error message when adding to cn=schema,cn=config (OLCSchemaConfig)

6/12/08 10:03:56 AM Workgroup Manager[28867] Got unexpected error of type eDSAttributeNotFound (-14134) on line 423 of /SourceCache/WorkgroupManager/WorkgroupManager-319.1.1/Plugins/Inspector/Inspec torPluginView.m

What the F does that mean? Come on Apple get with it, I'm sick of this s@#* not working!

I've changed the ACLs for the config database to be by * write so it should be wide open for editing.

(both in slapd_macosxserver.conf and in olcDatabase={0}config, cn=config olcAccess)

Message was edited by: soulsurf

Aug 15, 2008 5:42 AM in response to agrieveduser

Hello,

Here is a procedure to add a custom schema on a MacOS 10.5 Server Master LDAP.

1. Copy your file called Custom.schema to /etc/openldap/schema (Same as 10.4)
2. Add the line include /etc/openldap/schema/Custom.schema at the bottom of the file /etc/openldap/slapd.conf (Same as 10.4)
3. Create an archive of the folder /etc/openldap/slapd.d (Just to be safe)
4. Empty the folder /etc/openldap/slapd.d (not delete it just empty it!)
5. Run the command (on root user) «slaptest -v -d 68 -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d» (the -v -d 68 are not necessary just to have more details about what append)
6. Control that the folder /etc/openldap/slapd.d has is files again
7. Restart the computer
8. Launch Workroup Manager
9. Clic the Inspector button and go to the OLCSchemaConfig Menu
10. You schould see now your custom schema in the list of left side of the window!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Adding a custom LDAP schema to a Mac OS 10.5.2 server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.