6.6. Including your own LDAP schemas

If your service or module needs LDAP schemas that are not included in the default installation, you'll have to implement _includeLDAPSchemas. In this method, you have to return a reference to an array that contains the paths to the schemas you need. They will be added to slapd.conf.

Let's see how the samba module does this. It needs the samba.schema schema.

Example 6.2. Implementing _includeLDAPSchemas

sub _includeLDAPSchemas {
	my $self = shift;

	return ['/etc/ldap/schema/samba.schema'];	
}  

The resulting slapd.conf file is as follows:

# Schema and objectClass definitions
include		/etc/ldap/schema/core.schema
include		/etc/ldap/schema/cosine.schema
include		/etc/ldap/schema/nis.schema
include		/etc/ldap/schema/inetorgperson.schema
include		/etc/ldap/schema/samba.schema