5.3. Linking Attributes to Manage Attribute Values
5.3.1. About Linking Attributes
linkType) and one attribute which is automatically maintained by the plug-in (managedType).

Figure 5.4. Basic Linked Attribute Configuration
Note

Figure 5.5. Restricting the Linked Attribute Plug-in to a Specific Subtree
- Both the managed attribute and linked attribute must require the Distinguished Name syntax in their attribute definitions. The linked attributes are essentially managed cross-references, and the way that the plug-in handles these cross-references is by pulling the DN of the entry from the attribute value.For information on planning custom schema elements, see Chapter 8, Managing the Directory Schema.
- Each Linked Attribute Plug-in instance must be local and any managed attributes must be blocked from replication using fractional replication.Any changes that are made on one supplier will automatically trigger the plug-in to manage the values on the corresponding directory entries, so the data stay consistent across servers. However, the managed attributes must be maintained by the plug-in instance for the data to be consistent between the linked entries. This means that managed attribute values should be maintained solely by the plug-in processes, not the replication process, even in a multi-master replication environment.For information on using fractional replication, see Section 11.1.7, “Replicating a Subset of Attributes with Fractional Replication”.
5.3.2. Looking at the Linking Attributes Plug-in Syntax
- The attribute that is managed manually by administrators, in the
linkTypeattribute - The attribute that is created dynamically by the plug-in, in the
managedTypeattribute - Optionally, a scope that restricts the plug-in to a specific part of the directory tree, in the
linkScopeattribute
Example 5.4. Example Linked Attributes Plug-in Instance Entry
dn: cn=Manager Link,cn=Linked Attributes,cn=plugins,cn=config objectClass: top objectClass: extensibleObject cn: Manager Link1 cn: Manager Link linkType: directReport managedType: manager linkScope: ou=people,dc=example,dc=com
Table 5.2. Linked Attributes Plug-in Instance Attributes
| Plug-in Attribute | Description |
|---|---|
| cn | Gives a unique name for the plug-in instance. |
| linkScope | Contains the DN of a suffix to which to restrict the function of the plug-in instance. |
| linkType | Gives the attribute which is maintained by an administrator. This attribute is manually maintained and is used as the reference for the plug-in. This attribute must have a DN value format. When the attribute is added, modified, or deleted, then its value contains the DN of the target entry for the plug-in to update. |
| managedType | Gives the attribute which is maintained by the plug-in. This attribute is created and updated on target entries. This attribute must have a DN value format. When the attribute is added to the entry, its value will point back as a cross-reference to the managed entry. |
5.3.3. Configuring Attribute Links
Note
- If it is not already enabled, enable the Linked Attributes Plug-in, as described in Section 1.8.1, “Enabling Plug-ins in the Directory Server Console”. For example:
[root@server ~]# ldapmodify -D "cn=directory manager" -W -x dn: cn=Linked Attributes,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on
- Create the plug-in instance. Both the
managedTypeandlinkTypeattributes are required. The plug-in syntax is covered in Section 5.3.2, “Looking at the Linking Attributes Plug-in Syntax”. For example:ldapmodify
-a-D "cn=directory manager" -W -p 389 -h server.example.com -x dn: cn=Manager Link,cn=Linked Attributes,cn=plugins,cn=config changetype: add objectClass: top objectClass: extensibleObject cn: Manager Link linkType: directReport managedType: manager - Restart the server to apply the new plug-in instance.
service dirsrv restart
5.3.4. Cleaning up Attribute Links
fixup-linkedattrs.pl) or by launching a fix-up task.
5.3.4.1. Regenerating Linked Attributes Using fixup-linkedattrs.pl
fixup-linkedattrs.pl script launches a special task to regenerate all of the managed-link attribute pairs on directory entries. One or the other may be lost in certain situations. If the link attribute exists in an entry, the task traces the cross-referenced DN in the available attribute and creates the corresponding configured managed attribute on the referenced entry. If a managed attribute exists with no corresponding link attribute, then the managed attribute value is removed.
/usr/lib64/dirsrv/instance_name/fixup-linkedattrs.pl -D "cn=Directory Manager" -w password
-l option to specify the target plug-in instance DN:
/usr/lib64/dirsrv/instance_name/fixup-linkedattrs.pl -D "cn=Directory Manager" -w password -l "cn=Manager Link,cn=Linked Attributes,cn=plugins,cn=config"
fixup-linkedattrs.pl tool is described in more detail in the Configuration and Command-Line Tool Reference.
5.3.4.2. Regenerating Linked Attributes Using ldapmodify
cn=tasks configuration entry in the dse.ldif file, so it is also possible to initiate a task by adding the entry using ldapmodify. When the task is complete, the entry is removed from the directory.
fixup-linkedattrs.pl script when it is run.
cn=fixup linked attributes,cn=tasks,cn=config entry. The only required attribute is the cn for the specific task, though it also allows the ttl attribute to set a timeout period.
ldapmodify -a -D "cn=directory manager" -W -p 389 -h server.example.com -x
dn: cn=example,cn=fixup linked attributes,cn=tasks,cn=config
changetype: add
cn:example
ttl: 5dse.ldif configuration, so it is possible to reuse the same task entry continually.
cn=fixup linked attributes task configuration is described in more detail in the Configuration and Command-Line Tool Reference.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.