7.5. Processing an LDAP Compare Operation

When the Directory Server receives an LDAP compare request from a client, the frontend gets the DN of the entry being compared and the attribute and value being used in the comparison.
The frontend makes this information available to pre-operation and post-operation plug-in functions in the form of parameters in a parameter block.

Table 7.4. Table of Information Returned during an LDAP Compare Operation

Parameter ID Data Type Description
SLAPI_COMPARE_TARGET char * DN of the entry to be compared.
SLAPI_COMPARE_TYPE char * Attribute type to use in the comparison.
SLAPI_COMPARE_VALUE struct berval * Attribute value to use in the comparison.
The compare function should call slapi_send_ldap_result() to send LDAP_COMPARE_TRUE if the specified value is equal to the value of the entry's attribute or LDAP_COMPARE_FALSE if the values are not equal.
If successful, the compare function should return 0. If an error occurs (for example, if the specified attribute doesn't exist), the compare function should call slapi_send_ldap_result() to send an LDAP error code and should return 1.