HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
5.5.3.3.2 Finding a specific attribute in an entry
To determine if an entry contains a specific attribute, call the “slapi_entry_attr_find()” function.
This function returns 0 if the entry contains the attribute, -1 if it does not.
5.5.3.4 Adding and removing values
You can call front end routines to add or remove attributes and values in an entry. The front end
provides the following functionality:
To add new values to an entry, call the slapi_entry_add_values_sv() function.
To remove values from an entry, call the slapi_entry_delete_values_sv() function.
In certain situations, you may want to add an attribute and its values to an entry while not
replacing any attribute values that already exist. To do this, call the
slapi_entry_attr_merge_sv() function.
5.6 Working with DNs and RDNs
In certain situations, the front end passes DNs to the back end through the parameter block. For
example, when calling the add function, the parameter block includes a parameter that specifies
the DN of the new entry to be added.
If you need to manipulate DNs within parameter blocks, you can call the following front end
routines:
Table 5-2 Front end functions for manipulating DNs
DescriptionFunction
Determines if a DN is the root DN (the DN of the privileged superuser).“slapi_dn_isroot()”
Gets a copy of the parent DN.slapi_sdn_get_parent()
slapi_sdn_get_backend_parent()
Checks if a Slapi_DN structure is the child of another suffix.
slapi_sdn_issuffix()
Determines if a DN is a suffix served by one of the server's back ends.slapi_be_issuffix()
Normalizes a DN.slapi_sdn_get_ndn()
Normalizes a DN and converts all characters to lowercase.“slapi_dn_normalize_case()”
5.6.1 Determining if a DN is the root DN
To determine if a DN is the root DN, call “slapi_dn_isroot()”. This function returns 1 if the
specified DN is the root DN of the local database. It returns 0 if the DN is not the root DN.
5.6.2 Working with DN suffixes
A suffix of a DN identifies a subtree in the directory tree where the DN is located. For example,
consider the following DN:
cn=Babs Jensen,ou=Product Development,l=US, dc=example,dc=com
In this case, one of the suffixes is:
l=US, dc=example,dc=com
This suffix indicates that the Babs Jensen entry is located in the Example Corporation
subtree in the directory tree.
To determine if a value is a suffix for a DN, call slapi_sdn_issuffix(). To determine if a DN is one
of the suffixes served by the back end, call the slapi_be_issuffix() function.
For more information on suffixes and back end configuration, see the HP-UX Directory Server
administrator guide.
5.6 Working with DNs and RDNs 53