- return rc;
-}
-
-static int
-slapi_op_compare_init( Operation *op, SlapReply *rs )
-{
- Slapi_PBlock *pb = SLAPI_OPERATION_PBLOCK( op );
-
- slapi_pblock_set( pb, SLAPI_COMPARE_TYPE, (void *)op->orc_ava->aa_desc->ad_cname.bv_val );
- slapi_pblock_set( pb, SLAPI_COMPARE_VALUE, (void *)&op->orc_ava->aa_value );
-
- return LDAP_SUCCESS;
-}
-
-static int
-slapi_op_modify_init( Operation *op, SlapReply *rs )
-{
- Slapi_PBlock *pb = SLAPI_OPERATION_PBLOCK( op );
- LDAPMod **modv = NULL;
-
- modv = slapi_int_modifications2ldapmods( &op->orm_modlist );
- slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv );
-
- return LDAP_SUCCESS;
-}
-
-static int
-slapi_op_modify_callback( Operation *op, SlapReply *rs )
-{
- Slapi_PBlock *pb = SLAPI_OPERATION_PBLOCK( op );
- LDAPMod **modv = NULL;
-
- /* check preoperation result code */
- if ( rs->sr_err < 0 ) {
- slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
- return rs->sr_err;
- }
-
- /*
- * NB: it is valid for the plugin to return no modifications
- * (for example, a plugin might store some attributes elsewhere
- * and remove them from the modification list; if only those
- * attribute types were included in the modification request,
- * then slapi_int_ldapmods2modifications() above will return
- * NULL).
- *
- * However, the post-operation plugin should still be
- * called.
- */
-
- slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
- op->orm_modlist = slapi_int_ldapmods2modifications( modv );
-
- return LDAP_SUCCESS;
-}
-
-static int
-slapi_op_modify_cleanup( Operation *op, SlapReply *rs )
-{
- Slapi_PBlock *pb = SLAPI_OPERATION_PBLOCK( op );
- LDAPMod **modv = NULL;
-
- slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
-
- if ( modv != NULL )
- slapi_int_free_ldapmods( modv );
-
- return LDAP_SUCCESS;
-}
-
-static int
-slapi_op_modrdn_init( Operation *op, SlapReply *rs )
-{
- Slapi_PBlock *pb = SLAPI_OPERATION_PBLOCK( op );
-
- slapi_pblock_set( pb, SLAPI_MODRDN_NEWRDN, (void *)op->orr_newrdn.bv_val );
- slapi_pblock_set( pb, SLAPI_MODRDN_NEWSUPERIOR, (void *)op->orr_newSup->bv_val );
- slapi_pblock_set( pb, SLAPI_MODRDN_DELOLDRDN, (void *)op->orr_deleteoldrdn );
-
- return LDAP_SUCCESS;
-}
-
-static int
-slapi_op_search_init( Operation *op, SlapReply *rs )
-{
- Slapi_PBlock *pb = SLAPI_OPERATION_PBLOCK( op );
- char **attrs;
-
- attrs = anlist2charray_x( op->ors_attrs, 0, op->o_tmpmemctx );
-
- slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, (void *)op->ors_scope );
- slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, (void *)op->ors_deref );
- slapi_pblock_set( pb, SLAPI_SEARCH_SIZELIMIT, (void *)op->ors_slimit );
- slapi_pblock_set( pb, SLAPI_SEARCH_TIMELIMIT, (void *)op->ors_tlimit );
- slapi_pblock_set( pb, SLAPI_SEARCH_FILTER, (void *)op->ors_filter );
- slapi_pblock_set( pb, SLAPI_SEARCH_STRFILTER, (void *)op->ors_filterstr.bv_val );
- slapi_pblock_set( pb, SLAPI_SEARCH_ATTRS, (void *)attrs );
- slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, (void *)op->ors_attrsonly );
-
- return LDAP_SUCCESS;