Copying restrictions apply. See LICENSE.
The overlay operates on configured variant entries which can have several attributes each configured to borrow values from an attribute in the alternate entry.
Two types of variant entries can be configured, regular and regex , where the latter are configured with a regular expression and patterns to locate each alternate entry, with access to the variant DN and first nine submatches captured by the regular expression.
For most purposes (see LIMITATIONS , especially for regex variants), the resulting entry is completely transparent to the operations performed on it, e.g. a modify operation on the variant attribute gets transformed into an operation on the alternate entry+attribute. As such, the usual ACL rules apply, appropriate access to both the variant and alternate entry is checked.
As a special case, Add and Delete operations will not affect the alternate entries. Should an attempt be made to add a configured variant entry with the variant attributes already populated, the operation will be rejected with a Constraint Violation .
objectClass=olcVariantConfig Main overlay configuration. Created directly under the database configuration entry.
objectClass=olcVariantVariant Specifies a regular variant entry and must be a child of an entry with objectClass=olcVariantConfig . There may be as many such entries as necessary provided they all specify a different DN in the olcVariantEntry attribute.
objectClass=olcVariantAttribute Specifies a regular variant attribute together with information where the alternate attribute is stored. Must be a child of an entry with objectClass=olcVariantVariant . There may be as many such entries as necessary provided they all specify a different attribute in olcVariantVariantAttribute .
objectClass=olcVariantRegex Specifies a regex variant entry and must be a child of an entry with objectClass=olcVariantConfig . There may be as many such entries as necessary provided they all specify a different DN in the olcVariantEntryRegex attribute.
objectClass=olcVariantAttributePattern Specifies a regex variant attribute together with information where the alternate attribute is stored. Must be a child of an entry with objectClass=olcVariantRegex . There may be as many such entries as necessary provided they all specify a different attribute in olcVariantVariantAttribute .
olcVariantPassReplication: TRUE | FALSE If set to TRUE , search operations with the SyncReplication control will be passed unchanged so that replication can be unaffected. Defaults to FALSE while unset. The slapd.conf (5) equivalent is passReplication .
olcVariantEntry: <dn> Mandatory attribute, indicates that the named entry is to be treated as a variant entry. The slapd.conf (5) equivalent is variantDN .
name: <reference> Name of the entry for reference, usually the attribute present in the configuration entry's RDN. There is no slapd.conf (5) equivalent as this has no effect on the overlay operation.
olcVariantRegex: <regex> Mandatory attribute, indicates that the entries whose normalised DN matches is to be treated as a regex variant entry. The (POSIX.2) regex can use submatches to capture parts of the DN for later use in locating the alternative entry . The slapd.conf (5) equivalent is variantRegex .
name: <reference> Name of the entry for reference, usually the attribute present in the configuration entry's RDN. There is no slapd.conf (5) equivalent as this has no effect on the overlay operation.
name: <reference> Name of the attribute configuration for reference and/or documentation, if present, usually found in the configuration entry's RDN. There is no slapd.conf (5) equivalent as this has no effect on the overlay operation.
olcVariantVariantAttribute: <attr> Mandatory attribute, indicates that the named attribute is not present in the variant entry but is to be retrieved from the alternate entry.
olcVariantAlternativeAttribute: <attr> Mandatory attribute, indicates that the values of the named attribute is to be retrieved from the alternate entry for use as the values of the variant attribute. The syntaxes of the corresponding variant and alternate attributes have to match or the configuration will be rejected.
olcVariantAlternativeEntry: <dn> Attribute mandatory for regular variants , indicates the alternate entry to use when retrieving the attribute from.
olcVariantAlternativeEntryPattern: <pattern> Attribute mandatory for regex variants , indicates the alternate entry to use when retrieving the attribute from. Substitution patterns ( $n ) can be used to insert parts of the variant entry's DN. $0 will place the entire variant DN, $1 to $9 can be used to place respective capture patterns from the variant entry.
variantSpec <attr> <attr2> <dn> slapd.conf (5) only. The equivalent to options above, where <attr> represents the olcVariantVariantAttribute , <attr2> represents the olcVariantAlternativeAttribute and <dn> has the same meaning as the content of olcVariantAlternativeEntry . Has to follow a variantDN line in the overlay's configuration.
variantRegexSpec <attr> <attr2> <pattern> slapd.conf (5) only. The equivalent to options above, where <attr> represents the olcVariantVariantAttribute , <attr2> represents the olcVariantAlternativeAttribute and <pattern> has the same meaning as the content of olcVariantAlternativeEntryPattern . Has to follow a variantRegex line in the overlay's configuration.
dn: olcOverlay={x}variant,$DATABASE objectClass: olcVariantConfig olcOverlay: variant # Let replication requests pass through unmodified olcVariantPassReplication: TRUE # when an operation considers dc=example,dc=com dn: name=example,olcOverlay={x}variant,$DATABASE objectClass: olcVariantVariant olcVariantEntry: dc=example,dc=com # share the Headquarters' address as the company address dn: olcVariantVariantAttribute=postaladdress,name={0}example,olcOverlay={x}variant,$DATABASE objectClass: olcVariantVariantAttribute olcVariantVariantAttribute: postaladdress olcVariantAlternativeAttribute: postaladdress olcVariantAlternativeEntry: ou=Headquarters,dc=example,dc=com # populate telephonenumber from CEO's home phone dn: name=Take phone from CEO entry,name={0}example,olcOverlay={x}variant,$DATABASE objectClass: olcVariantVariantAttribute olcVariantVariantAttribute: telephonenumber olcVariantAlternativeAttribute: homephone olcVariantAlternativeEntry: cn=John Doe,ou=People,dc=example,dc=com # Match all entries with example in the DN # # It will not match dc=example,dc=com as that's already configured as a regular # variant dn: name=example 2,olcOverlay={x}variant,$DATABASE objectClass: olcVariantRegex olcVariantEntryRegex: .*example[^,]*,(.*) dn: olcVariantVariantAttribute=location,name={1}example 2,olcOverlay={x}variant,$DATABASE objectClass: olcVariantAttributePattern olcVariantVariantAttribute: location olcVariantAlternativeAttribute: location olcVariantAlternativeEntryPattern: ou=object with location,$1The slapd.conf (5) equivalent of the above follows (note that the converted cn=config will differ in the first variant attribute configuration entry):
overlay variant passReplication TRUE variantDN dc=example,dc=com variantSpec telephonenumber homephone "cn=John Doe,ou=People,dc=example,dc=com" variantSpec postaladdress postaladdress ou=Headquarters,dc=example,dc=com variantRegex .*example[^,]*,(.*) variantRegexSpec location location "ou=object with location,$1"
ETCDIR/slapd.conf default slapd configuration file
ETCDIR/slapd.d default slapd configuration directory