HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
49 Functions related to data interoperability
This chapter contains reference information on routines that support the data interoperability
feature of Directory Server, which is explained in Chapter 13 “Using data interoperability
plug-ins”. This set of functions allows a custom plug-in to preserve the default behavior of the
Directory Server and bypass access control checking.
Table 49-1 Routines related to data interoperability
DescriptionFunction
Allows a plug-in to recognize reserved default operations of the Directory
Server.
“slapi_op_reserved()”
Sets a flag for the operation.“slapi_operation_set_flag()”
Clears a flag for the operation.“slapi_operation_clear_flag()”
Determines whether a flag is set in the operation.“slapi_operation_is_flag_set()”
49.1 slapi_op_reserved()
Description This function allows a plug-in to recognize reserved default operations, such as
the base-scope search on the root dse and the operations on the reserved naming contexts, for
handling by the core Directory Server and not by the DIOP plug-in. This function allows you to
implement a custom DIOP plug-in that does not affect the default behavior of the server. The
code snippet below is a sample for a plug-in that handles the LDAP delete operation. The callback
for the LDAP delete operation nullsuffix_delete will ignore all the LDAP delete operations
on the reserved-naming contexts (such as cn=schema, cn=config, and cn=monitor).
#define PLUGIN_OPERATION_HANDLED 0
#define PLUGIN_OPERATION_IGNORED 1
static int nullsuffix_delete( Slapi_PBlock *pb )
{
if( slapi_op_reserved(pb) ){
return PLUGIN_OPERATION_IGNORED;
}
slapi_log_error( SLAPI_LOG_PLUGIN, PLUGIN_NAME,
"nullsuffix_delete\n" );
/* do the deletes */
send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL );
return PLUGIN_OPERATION_HANDLED; }
Syntax
#include "slapi-plugin.h"
int slapi_op_reserved(Slapi_PBlock *pb);
Parameter This function takes the following parameter:
Parameter block.
pb
Returns This function returns 0 if the operation is not reserved and a nonzero value if the
operation is reserved.
49.2 slapi_operation_set_flag()
Description This function sets the specified flag for the operation. The code sample demonstrates
how the flag for the operation is to be set:
Slapi_Operation *op;
if ( slapi_pblock_get( pb, SLAPI_OPERATION, &op ) != 0 ) {
49.1 slapi_op_reserved() 371