1 /* slapi_overlay.c - SLAPI overlay */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2001-2005 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
17 * This work was initially developed by Luke Howard for inclusion
18 * in OpenLDAP Software.
25 #include <ac/string.h>
26 #include <ac/socket.h>
33 static slap_overinst slapi;
36 slapi_over_compute_output(
37 computed_attr_context *c,
38 Slapi_Attr *attribute,
44 AttributeDescription *desc;
45 Operation *op = c->cac_op;
46 SlapReply *rs = (SlapReply *)c->cac_private;
48 if ( c == NULL || attribute == NULL || entry == NULL ) {
52 assert( rs->sr_entry == entry );
54 desc = attribute->a_desc;
56 if ( rs->sr_attrs == NULL ) {
57 /* All attrs request, skip operational attributes */
58 if ( is_at_operational( desc->ad_type ) ) {
62 /* Specific attributes requested */
63 if ( is_at_operational( desc->ad_type ) ) {
64 if ( !SLAP_OPATTRS( rs->sr_attr_flags ) &&
65 !ad_inlist( desc, rs->sr_attrs ) ) {
69 if ( !SLAP_USERATTRS( rs->sr_attr_flags ) &&
70 !ad_inlist( desc, rs->sr_attrs ) ) {
76 if ( !access_allowed( op, entry, desc, NULL, ACL_READ, c->cac_acl_state) ) {
77 slapi_log_error( SLAPI_LOG_ACL, "slapi_over_compute_output",
78 "acl: access to attribute %s not allowed\n",
79 desc->ad_cname.bv_val );
83 for ( a = &rs->sr_operational_attrs; *a != NULL; a = &(*a)->a_next )
86 *a = attr_dup( attribute );
92 slapi_over_aux_operational( Operation *op, SlapReply *rs )
94 /* Support for computed attribute plugins */
95 computed_attr_context ctx;
97 AccessControlState acl_state = ACL_STATE_INIT;
99 ctx.cac_pb = SLAPI_OPERATION_PBLOCK( op );
101 ctx.cac_private = rs;
102 ctx.cac_acl_state = &acl_state;
104 if ( rs->sr_entry != NULL ) {
106 * For each client requested attribute, call the plugins.
108 if ( rs->sr_attrs != NULL ) {
109 for ( anp = rs->sr_attrs; anp->an_name.bv_val != NULL; anp++ ) {
110 if ( compute_evaluator( &ctx, anp->an_name.bv_val,
111 rs->sr_entry, slapi_over_compute_output ) == 1 ) {
117 * Technically we shouldn't be returning operational attributes
118 * when the user requested only user attributes. We'll let the
119 * plugin decide whether to be naughty or not.
121 compute_evaluator( &ctx, "*", rs->sr_entry, slapi_over_compute_output );
125 return SLAP_CB_CONTINUE;
129 slapi_over_search( Operation *op, SlapReply *rs, int type )
134 assert( rs->sr_type == REP_SEARCH || rs->sr_type == REP_SEARCHREF );
136 pb = slapi_pblock_new();
138 slapi_int_pblock_set_operation( pb, op );
139 slapi_pblock_set( pb, SLAPI_RESCONTROLS, (void *)rs->sr_ctrls );
140 slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY, (void *)rs->sr_entry );
142 rc = slapi_int_call_plugins( op->o_bd, type, pb );
143 if ( rc >= 0 ) /* 1 means no plugins called */
144 rc = SLAP_CB_CONTINUE;
146 rc = LDAP_SUCCESS; /* confusing: don't abort, but don't send */
148 slapi_pblock_set( pb, SLAPI_RESCONTROLS, NULL ); /* don't free */
149 slapi_pblock_destroy(pb);
155 slapi_over_merge_controls( Operation *op, SlapReply *rs, Slapi_PBlock *pb)
157 LDAPControl **slapiControls = NULL, **mergedControls;
158 int nSlapiControls = 0;
159 int nResControls = 0;
162 /* merge in controls */
163 if ( rs->sr_ctrls != NULL ) {
164 for ( nResControls = 0; rs->sr_ctrls[nResControls] != NULL; nResControls++ )
167 slapi_pblock_get( pb, SLAPI_RESCONTROLS, (void **)&slapiControls );
168 if ( slapiControls != NULL ) {
169 for ( nSlapiControls = 0; slapiControls[nSlapiControls] != NULL; nSlapiControls++ )
173 if ( nResControls + nSlapiControls == 0 ) {
178 /* XXX this is a bit tricky, rs->sr_ctrls may have been allocated on stack */
179 mergedControls = (LDAPControl **)op->o_tmpalloc( ( nResControls + nSlapiControls + 1 ) *
180 sizeof( LDAPControl *), op->o_tmpmemctx );
181 if ( mergedControls == NULL ) {
185 if ( rs->sr_ctrls != NULL ) {
186 for ( i = 0; i < nResControls; i++ )
187 mergedControls[i] = rs->sr_ctrls[i];
189 if ( slapiControls != NULL ) {
190 for ( i = 0; i < nSlapiControls; i++ )
191 mergedControls[nResControls + i] = slapiControls[i];
193 mergedControls[nResControls + nSlapiControls] = NULL;
195 if ( slapiControls != NULL ) {
196 slapi_ch_free( (void **)&slapiControls );
197 slapi_pblock_set( pb, SLAPI_RESCONTROLS, NULL ); /* don't free */
200 rs->sr_ctrls = mergedControls;
206 slapi_over_result( Operation *op, SlapReply *rs, int type )
209 Slapi_PBlock *pb = SLAPI_OPERATION_PBLOCK( op );
211 assert( rs->sr_type == REP_RESULT );
213 slapi_pblock_set( pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
214 slapi_pblock_set( pb, SLAPI_RESULT_TEXT, (void *)rs->sr_text );
215 slapi_pblock_set( pb, SLAPI_RESULT_MATCHED, (void *)rs->sr_matched );
217 rc = slapi_int_call_plugins( op->o_bd, type, pb );
219 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
220 slapi_pblock_get( pb, SLAPI_RESULT_TEXT, (void **)&rs->sr_text );
221 slapi_pblock_get( pb, SLAPI_RESULT_MATCHED, (void **)&rs->sr_matched );
223 if ( type == SLAPI_PLUGIN_PRE_RESULT_FN ) {
224 rc = slapi_over_merge_controls( op, rs, pb );
227 return SLAP_CB_CONTINUE;
231 slapi_op_add_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
233 slapi_pblock_set( pb, SLAPI_ADD_ENTRY, (void *)op->ora_e );
239 slapi_op_bind_preop_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
241 slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)op->o_req_dn.bv_val );
242 slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)op->orb_method );
243 slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
244 slapi_pblock_set( pb, SLAPI_CONN_DN, NULL );
250 slapi_op_bind_postop_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
254 if ( rs->sr_err == LDAP_SUCCESS ) {
255 /* fix for ITS#2971 */
256 slapi_pblock_set( pb, SLAPI_CONN_DN, op->o_conn->c_authz.sai_dn.bv_val );
263 slapi_op_bind_callback( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
268 case SLAPI_BIND_SUCCESS:
269 /* Continue with backend processing */
271 case SLAPI_BIND_FAIL:
272 /* Failure, frontend (that's us) sends result */
273 rs->sr_err = LDAP_INVALID_CREDENTIALS;
274 send_ldap_result( op, rs );
277 case SLAPI_BIND_ANONYMOUS: /* undocumented */
280 * Plugin sent authoritative result or no plugins were called
282 if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err ) != 0 ) {
283 rs->sr_err = LDAP_OTHER;
286 BER_BVZERO( &op->orb_edn );
288 if ( rs->sr_err == LDAP_SUCCESS ) {
289 slapi_pblock_get( pb, SLAPI_CONN_DN, (void *)&op->orb_edn.bv_val );
290 if ( BER_BVISNULL( &op->orb_edn ) ) {
292 /* No plugins were called; continue processing */
296 op->orb_edn.bv_len = strlen( op->orb_edn.bv_val );
298 rs->sr_err = dnPrettyNormal( NULL, &op->orb_edn,
299 &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
301 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
302 ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
303 ber_dupbv(&op->o_conn->c_ndn, &op->o_req_ndn);
304 op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
305 BER_BVZERO( &op->o_req_dn );
306 op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
307 BER_BVZERO( &op->o_req_ndn );
308 if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
309 ber_len_t max = sockbuf_max_incoming_auth;
310 ber_sockbuf_ctrl( op->o_conn->c_sb,
311 LBER_SB_OPT_SET_MAX_INCOMING, &max );
314 /* log authorization identity */
315 Statslog( LDAP_DEBUG_STATS,
316 "%s BIND dn=\"%s\" mech=%s (SLAPI) ssf=0\n",
318 BER_BVISNULL( &op->o_conn->c_dn )
319 ? "<empty>" : op->o_conn->c_dn.bv_val,
320 op->orb_tmp_mech.bv_val, 0, 0 );
322 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
332 slapi_op_compare_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
334 slapi_pblock_set( pb, SLAPI_COMPARE_TYPE, (void *)op->orc_ava->aa_desc->ad_cname.bv_val );
335 slapi_pblock_set( pb, SLAPI_COMPARE_VALUE, (void *)&op->orc_ava->aa_value );
341 slapi_op_modify_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
343 LDAPMod **modv = NULL;
345 modv = slapi_int_modifications2ldapmods( &op->orm_modlist );
346 slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv );
352 slapi_op_modify_callback( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
354 LDAPMod **modv = NULL;
356 /* check preoperation result code */
357 if ( rs->sr_err < 0 ) {
358 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
363 * NB: it is valid for the plugin to return no modifications
364 * (for example, a plugin might store some attributes elsewhere
365 * and remove them from the modification list; if only those
366 * attribute types were included in the modification request,
367 * then slapi_int_ldapmods2modifications() above will return
370 * However, the post-operation plugin should still be
374 slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
375 op->orm_modlist = slapi_int_ldapmods2modifications( modv );
381 slapi_op_modify_cleanup( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
383 LDAPMod **modv = NULL;
385 slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
388 slapi_int_free_ldapmods( modv );
394 slapi_op_modrdn_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
396 slapi_pblock_set( pb, SLAPI_MODRDN_NEWRDN, (void *)op->orr_newrdn.bv_val );
397 slapi_pblock_set( pb, SLAPI_MODRDN_NEWSUPERIOR, (void *)op->orr_newSup->bv_val );
398 slapi_pblock_set( pb, SLAPI_MODRDN_DELOLDRDN, (void *)op->orr_deleteoldrdn );
404 slapi_op_search_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
408 attrs = anlist2charray_x( op->ors_attrs, 0, op->o_tmpmemctx );
410 slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, (void *)op->ors_scope );
411 slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, (void *)op->ors_deref );
412 slapi_pblock_set( pb, SLAPI_SEARCH_SIZELIMIT, (void *)op->ors_slimit );
413 slapi_pblock_set( pb, SLAPI_SEARCH_TIMELIMIT, (void *)op->ors_tlimit );
414 slapi_pblock_set( pb, SLAPI_SEARCH_FILTER, (void *)op->ors_filter );
415 slapi_pblock_set( pb, SLAPI_SEARCH_STRFILTER, (void *)op->ors_filterstr.bv_val );
416 slapi_pblock_set( pb, SLAPI_SEARCH_ATTRS, (void *)attrs );
417 slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, (void *)op->ors_attrsonly );
423 slapi_op_search_callback( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
425 /* check preoperation result code */
426 if ( rs->sr_err < 0 ) {
427 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
431 if ( slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN, pb ) != 0 ) {
436 * The plugin can set the SLAPI_SEARCH_FILTER.
437 * SLAPI_SEARCH_STRFILER is not normative.
439 slapi_pblock_get( pb, SLAPI_SEARCH_FILTER, (void *)&op->ors_filter );
440 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
441 filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
443 slapi_pblock_get( pb, SLAPI_SEARCH_TARGET, (void **)&op->o_req_dn.bv_val );
444 op->o_req_dn.bv_len = strlen( op->o_req_dn.bv_val );
446 if( !BER_BVISNULL( &op->o_req_ndn ) ) {
447 slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
449 rs->sr_err = dnNormalize( 0, NULL, NULL, &op->o_req_dn, &op->o_req_ndn,
451 if ( rs->sr_err != LDAP_SUCCESS ) {
452 send_ldap_result( op, rs );
456 slapi_pblock_get( pb, SLAPI_SEARCH_SCOPE, (void **)&op->ors_scope );
457 slapi_pblock_get( pb, SLAPI_SEARCH_DEREF, (void **)&op->ors_deref );
463 slapi_op_search_cleanup( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
467 slapi_pblock_get( pb, SLAPI_SEARCH_ATTRS, (void *)&attrs );
470 op->o_tmpfree( attrs, op->o_tmpmemctx );
475 typedef int (slapi_over_callback)( Operation *, SlapReply *rs, Slapi_PBlock * );
477 struct slapi_op_info {
480 slapi_over_callback *soi_preop_init;
481 slapi_over_callback *soi_callback;
482 slapi_over_callback *soi_postop_init;
483 slapi_over_callback *soi_cleanup;
484 } slapi_op_dispatch_table[] = {
486 SLAPI_PLUGIN_PRE_BIND_FN,
487 SLAPI_PLUGIN_POST_BIND_FN,
488 slapi_op_bind_preop_init,
489 slapi_op_bind_callback,
490 slapi_op_bind_postop_init,
494 SLAPI_PLUGIN_PRE_UNBIND_FN, /* UNBIND */
495 SLAPI_PLUGIN_POST_UNBIND_FN,
502 SLAPI_PLUGIN_PRE_SEARCH_FN,
503 SLAPI_PLUGIN_POST_SEARCH_FN,
504 slapi_op_search_init,
505 slapi_op_search_callback,
507 slapi_op_search_cleanup
510 SLAPI_PLUGIN_PRE_COMPARE_FN,
511 SLAPI_PLUGIN_POST_COMPARE_FN,
512 slapi_op_compare_init,
518 SLAPI_PLUGIN_PRE_MODIFY_FN,
519 SLAPI_PLUGIN_POST_MODIFY_FN,
520 slapi_op_modify_init,
521 slapi_op_modify_callback,
523 slapi_op_modify_cleanup
526 SLAPI_PLUGIN_PRE_MODRDN_FN,
527 SLAPI_PLUGIN_POST_MODRDN_FN,
528 slapi_op_modrdn_init,
534 SLAPI_PLUGIN_PRE_ADD_FN,
535 SLAPI_PLUGIN_POST_ADD_FN,
542 SLAPI_PLUGIN_PRE_DELETE_FN,
543 SLAPI_PLUGIN_POST_DELETE_FN,
550 SLAPI_PLUGIN_PRE_ABANDON_FN,
551 SLAPI_PLUGIN_POST_ABANDON_FN,
568 slapi_tag2op( ber_tag_t tag )
579 case LDAP_REQ_DELETE:
582 case LDAP_REQ_MODRDN:
585 case LDAP_REQ_MODIFY:
588 case LDAP_REQ_COMPARE:
591 case LDAP_REQ_SEARCH:
594 case LDAP_REQ_UNBIND:
606 slapi_over_response( Operation *op, SlapReply *rs )
610 switch ( rs->sr_type ) {
612 rc = slapi_over_result( op, rs, SLAPI_PLUGIN_PRE_RESULT_FN );
615 rc = slapi_over_search( op, rs, SLAPI_PLUGIN_PRE_ENTRY_FN );
618 rc = slapi_over_search( op, rs, SLAPI_PLUGIN_PRE_REFERRAL_FN );
621 rc = SLAP_CB_CONTINUE;
629 slapi_over_cleanup( Operation *op, SlapReply *rs )
633 switch ( rs->sr_type ) {
635 rc = slapi_over_result( op, rs, SLAPI_PLUGIN_POST_RESULT_FN );
638 rc = slapi_over_search( op, rs, SLAPI_PLUGIN_POST_ENTRY_FN );
641 rc = slapi_over_search( op, rs, SLAPI_PLUGIN_POST_REFERRAL_FN );
644 rc = SLAP_CB_CONTINUE;
652 slapi_op_func( Operation *op, SlapReply *rs )
655 slap_operation_t which;
656 struct slapi_op_info *opinfo;
662 pb = SLAPI_OPERATION_PBLOCK( op );
665 * We check for op->o_extensions to verify that we are not
666 * processing a SLAPI internal operation. XXX
668 if ( pb == NULL || op->o_hdr->oh_extensions == NULL ) {
669 return SLAP_CB_CONTINUE;
673 * Find the SLAPI operation information for this LDAP
674 * operation; this will contain the preop and postop
675 * plugin types, as well as optional callbacks for
676 * setting up the SLAPI environment.
678 which = slapi_tag2op( op->o_tag );
679 if ( which >= op_last ) {
680 /* invalid operation, but let someone else deal with it */
681 return SLAP_CB_CONTINUE;
684 opinfo = &slapi_op_dispatch_table[which];
685 if ( opinfo == NULL || opinfo->soi_preop == 0 ) {
686 /* no SLAPI plugin types for this operation */
687 return SLAP_CB_CONTINUE;
690 slapi_int_pblock_set_operation( pb, op );
692 cb.sc_response = slapi_over_response; /* call pre-entry/result plugins */
693 cb.sc_cleanup = slapi_over_cleanup; /* call post-entry/result plugins */
694 cb.sc_private = opinfo;
695 cb.sc_next = op->o_callback;
696 op->o_callback = &cb;
699 * Call preoperation plugins
701 if ( opinfo->soi_preop_init != NULL ) {
702 rs->sr_err = (opinfo->soi_preop_init)( op, rs, pb );
703 if ( rs->sr_err != LDAP_SUCCESS )
707 rs->sr_err = slapi_int_call_plugins( op->o_bd, opinfo->soi_preop, pb );
710 * soi_callback is responsible for examining the result code
711 * of the preoperation plugin and determining whether to
712 * abort. This is needed because of special SLAPI behaviour
713 * with bind preoperation plugins.
715 * The soi_callback function is also used to reset any values
716 * returned from the preoperation plugin before calling the
717 * backend (for the success case).
719 if ( opinfo->soi_callback == NULL ) {
720 /* default behaviour is preop plugin can abort operation */
721 if ( rs->sr_err < 0 ) {
722 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
726 rc = (opinfo->soi_callback)( op, rs, pb );
732 * Call actual backend (or next overlay in stack)
734 on = (slap_overinst *)op->o_bd->bd_info;
737 rs->sr_err = overlay_op_walk( op, rs, which, oi, on->on_next );
740 * Call postoperation plugins
742 slapi_pblock_set( pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
744 if ( opinfo->soi_postop_init != NULL ) {
745 (opinfo->soi_postop_init)( op, rs, pb );
748 slapi_int_call_plugins( op->o_bd, opinfo->soi_postop, pb );
751 if ( opinfo->soi_cleanup != NULL ) {
752 (opinfo->soi_cleanup)( op, rs, pb );
755 op->o_callback = cb.sc_next;
761 slapi_over_extended( Operation *op, SlapReply *rs )
767 struct berval reqdata = BER_BVNULL;
769 pb = SLAPI_OPERATION_PBLOCK( op );
771 return SLAP_CB_CONTINUE;
774 slapi_int_get_extop_plugin( &op->ore_reqoid, &callback );
775 if ( callback == NULL ) {
776 return SLAP_CB_CONTINUE;
779 slapi_int_pblock_set_operation( pb, op );
781 if ( op->ore_reqdata != NULL ) {
782 reqdata = *op->ore_reqdata;
785 slapi_pblock_set( pb, SLAPI_EXT_OP_REQ_OID, (void *)op->ore_reqoid.bv_val);
786 slapi_pblock_set( pb, SLAPI_EXT_OP_REQ_VALUE, (void *)&reqdata);
788 rc = (*callback)( pb );
789 if ( rc == SLAPI_PLUGIN_EXTENDED_SENT_RESULT ) {
791 } else if ( rc == SLAPI_PLUGIN_EXTENDED_NOT_HANDLED ) {
792 return SLAP_CB_CONTINUE;
795 slapi_pblock_get( pb, SLAPI_EXT_OP_RET_OID, (void **)&rs->sr_rspoid );
796 slapi_pblock_get( pb, SLAPI_EXT_OP_RET_VALUE, (void **)&rs->sr_rspdata );
799 send_ldap_extended( op, rs );
801 if ( rs->sr_rspoid != NULL )
802 slapi_ch_free_string( (char **)&rs->sr_rspoid );
804 if ( rs->sr_rspdata != NULL )
805 ber_bvfree( rs->sr_rspdata );
811 slapi_over_access_allowed(
814 AttributeDescription *desc,
816 slap_access_t access,
817 AccessControlState *state,
822 rc = slapi_int_access_allowed( op, e, desc, val, access, state );
824 rc = SLAP_CB_CONTINUE;
830 slapi_over_acl_group(
833 struct berval *gr_ndn,
834 struct berval *op_ndn,
835 ObjectClass *group_oc,
836 AttributeDescription *group_at )
840 Slapi_PBlock *pb = SLAPI_OPERATION_PBLOCK( op );
841 BackendDB *be = NULL;
842 BackendDB *be_orig = op->o_bd;
845 return SLAP_CB_CONTINUE;
848 if ( target != NULL && dn_match( &target->e_nname, gr_ndn ) ) {
852 be = select_backend( gr_ndn, 0, 0 );
854 rc = LDAP_NO_SUCH_OBJECT;
857 rc = be_entry_get_rw( op, gr_ndn, group_oc, group_at, 0, &e );
863 return SLAP_CB_CONTINUE;
866 slapi_pblock_set( pb, SLAPI_X_GROUP_ENTRY, (void *)e );
867 slapi_pblock_set( pb, SLAPI_X_GROUP_OPERATION_DN, (void *)op_ndn->bv_val );
868 slapi_pblock_set( pb, SLAPI_X_GROUP_ATTRIBUTE, (void *)group_at->ad_cname.bv_val );
869 slapi_pblock_set( pb, SLAPI_X_GROUP_TARGET_ENTRY, (void *)target );
871 rc = slapi_int_call_plugins( op->o_bd, SLAPI_X_PLUGIN_PRE_GROUP_FN, pb );
873 rc = SLAP_CB_CONTINUE;
875 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rc );
877 slapi_pblock_set( pb, SLAPI_X_GROUP_ENTRY, NULL );
878 slapi_pblock_set( pb, SLAPI_X_GROUP_OPERATION_DN, NULL );
879 slapi_pblock_set( pb, SLAPI_X_GROUP_ATTRIBUTE, NULL );
880 slapi_pblock_set( pb, SLAPI_X_GROUP_TARGET_ENTRY, NULL );
884 be_entry_release_r( op, e );
889 * XXX don't call POST_GROUP_FN, I have no idea what the point of
890 * that plugin function was anyway
896 slapi_int_overlay_init()
898 memset( &slapi, 0, sizeof(slapi) );
900 slapi.on_bi.bi_type = SLAPI_OVERLAY_NAME;
902 slapi.on_bi.bi_op_bind = slapi_op_func;
903 slapi.on_bi.bi_op_unbind = slapi_op_func;
904 slapi.on_bi.bi_op_search = slapi_op_func;
905 slapi.on_bi.bi_op_compare = slapi_op_func;
906 slapi.on_bi.bi_op_modify = slapi_op_func;
907 slapi.on_bi.bi_op_modrdn = slapi_op_func;
908 slapi.on_bi.bi_op_add = slapi_op_func;
909 slapi.on_bi.bi_op_delete = slapi_op_func;
910 slapi.on_bi.bi_op_abandon = slapi_op_func;
911 slapi.on_bi.bi_op_cancel = slapi_op_func;
913 slapi.on_bi.bi_extended = slapi_over_extended;
914 slapi.on_bi.bi_access_allowed = slapi_over_access_allowed;
915 slapi.on_bi.bi_operational = slapi_over_aux_operational;
916 slapi.on_bi.bi_acl_group = slapi_over_acl_group;
918 return overlay_register( &slapi );
921 #endif /* LDAP_SLAPI */