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 = op->o_pb;
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 pb = slapi_pblock_new();
136 slapi_int_pblock_set_operation( pb, op );
137 slapi_pblock_set( pb, SLAPI_RESCONTROLS, (void *)rs->sr_ctrls );
138 slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY, (void *)rs->sr_entry );
140 rc = slapi_int_call_plugins( op->o_bd, type, pb );
141 if ( rc >= 0 ) /* 1 means no plugins called */
142 rc = SLAP_CB_CONTINUE;
144 rc = LDAP_SUCCESS; /* confusing: don't abort, but don't send */
146 if ( rc == SLAP_CB_CONTINUE && rs->sr_type == REP_SEARCH ) {
147 /* XXX we shouldn't need this here */
148 slapi_over_aux_operational( op, rs );
151 slapi_pblock_set( pb, SLAPI_RESCONTROLS, NULL ); /* don't free */
152 slapi_pblock_destroy(pb);
158 slapi_over_merge_controls( Operation *op, SlapReply *rs, Slapi_PBlock *pb)
160 LDAPControl **slapiControls = NULL, **resControls;
161 int nSlapiControls = 0;
162 int nResControls = 0;
165 /* merge in controls */
166 if ( rs->sr_ctrls != NULL ) {
167 for ( nResControls = 0; rs->sr_ctrls[nResControls] != NULL; nResControls++ )
170 slapi_pblock_get( op->o_pb, SLAPI_RESCONTROLS, (void **)&slapiControls );
171 if ( slapiControls != NULL ) {
172 for ( nSlapiControls = 0; slapiControls[nSlapiControls] != NULL; nSlapiControls++ )
176 /* XXX this is a bit tricky, rs->sr_ctrls may have been allocated on stack */
177 resControls = (LDAPControl **)op->o_tmpalloc( ( nResControls + nSlapiControls + 1 ) *
178 sizeof( LDAPControl *), op->o_tmpmemctx );
179 if ( resControls == NULL ) {
183 if ( rs->sr_ctrls != NULL ) {
184 for ( i = 0; i < nResControls; i++ )
185 resControls[i] = rs->sr_ctrls[i];
187 if ( slapiControls != NULL ) {
188 for ( i = 0; i < nSlapiControls; i++ )
189 resControls[nResControls + i] = slapiControls[i];
191 resControls[nResControls + nSlapiControls] = NULL;
193 if ( slapiControls != NULL ) {
194 slapi_ch_free( (void **)&slapiControls );
195 slapi_pblock_set( op->o_pb, SLAPI_RESCONTROLS, NULL ); /* don't free */
198 rs->sr_ctrls = resControls;
204 slapi_over_result( Operation *op, SlapReply *rs, int type )
208 slapi_pblock_set( op->o_pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
209 slapi_pblock_set( op->o_pb, SLAPI_RESULT_TEXT, (void *)rs->sr_text );
210 slapi_pblock_set( op->o_pb, SLAPI_RESULT_MATCHED, (void *)rs->sr_matched );
212 rc = slapi_int_call_plugins( op->o_bd, type, op->o_pb );
214 slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
215 slapi_pblock_get( op->o_pb, SLAPI_RESULT_TEXT, (void **)&rs->sr_text );
216 slapi_pblock_get( op->o_pb, SLAPI_RESULT_MATCHED, (void **)&rs->sr_matched );
218 if ( type == SLAPI_PLUGIN_PRE_RESULT_FN ) {
219 rc = slapi_over_merge_controls( op, rs, op->o_pb );
222 return SLAP_CB_CONTINUE;
226 slapi_op_add_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
228 slapi_pblock_set( pb, SLAPI_ADD_ENTRY, (void *)op->ora_e );
234 slapi_op_bind_preop_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
236 slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)op->o_req_dn.bv_val );
237 slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)op->orb_method );
238 slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
239 slapi_pblock_set( pb, SLAPI_CONN_DN, NULL );
245 slapi_op_bind_postop_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
249 if ( rs->sr_err == LDAP_SUCCESS ) {
250 /* fix for ITS#2971 */
251 slapi_pblock_set( pb, SLAPI_CONN_DN, op->o_conn->c_authz.sai_dn.bv_val );
258 slapi_op_bind_callback( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
263 case SLAPI_BIND_SUCCESS:
264 /* Continue with backend processing */
266 case SLAPI_BIND_FAIL:
267 /* Failure, frontend (that's us) sends result */
268 rs->sr_err = LDAP_INVALID_CREDENTIALS;
269 send_ldap_result( op, rs );
272 case SLAPI_BIND_ANONYMOUS: /* undocumented */
275 * Plugin sent authoritative result or no plugins were called
277 if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err ) != 0 ) {
278 rs->sr_err = LDAP_OTHER;
281 BER_BVZERO( &op->orb_edn );
283 if ( rs->sr_err == LDAP_SUCCESS ) {
284 slapi_pblock_get( pb, SLAPI_CONN_DN, (void *)&op->orb_edn.bv_val );
285 if ( BER_BVISNULL( &op->orb_edn ) ) {
287 /* No plugins were called; continue processing */
291 op->orb_edn.bv_len = strlen( op->orb_edn.bv_val );
293 rs->sr_err = dnPrettyNormal( NULL, &op->orb_edn,
294 &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
295 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
296 ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
297 ber_dupbv(&op->o_conn->c_ndn, &op->o_req_ndn);
298 op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
299 BER_BVZERO( &op->o_req_dn );
300 op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
301 BER_BVZERO( &op->o_req_ndn );
302 if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
303 ber_len_t max = sockbuf_max_incoming_auth;
304 ber_sockbuf_ctrl( op->o_conn->c_sb,
305 LBER_SB_OPT_SET_MAX_INCOMING, &max );
307 /* log authorization identity */
308 Statslog( LDAP_DEBUG_STATS,
309 "%s BIND dn=\"%s\" mech=%s (SLAPI) ssf=0\n",
311 BER_BVISNULL( &op->o_conn->c_dn )
312 ? "<empty>" : op->o_conn->c_dn.bv_val,
313 op->orb_tmp_mech.bv_val, 0, 0 );
324 slapi_op_compare_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
326 slapi_pblock_set( pb, SLAPI_COMPARE_TYPE, (void *)op->orc_ava->aa_desc->ad_cname.bv_val );
327 slapi_pblock_set( pb, SLAPI_COMPARE_VALUE, (void *)&op->orc_ava->aa_value );
333 slapi_op_modify_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
335 LDAPMod **modv = NULL;
337 modv = slapi_int_modifications2ldapmods( &op->orm_modlist );
338 slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv );
344 slapi_op_modify_callback( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
346 LDAPMod **modv = NULL;
348 /* check preoperation result code */
349 if ( rs->sr_err < 0 ) {
350 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
355 * NB: it is valid for the plugin to return no modifications
356 * (for example, a plugin might store some attributes elsewhere
357 * and remove them from the modification list; if only those
358 * attribute types were included in the modification request,
359 * then slapi_int_ldapmods2modifications() above will return
362 * However, the post-operation plugin should still be
366 slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
367 op->orm_modlist = slapi_int_ldapmods2modifications( modv );
373 slapi_op_modify_cleanup( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
375 LDAPMod **modv = NULL;
377 slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
380 slapi_int_free_ldapmods( modv );
386 slapi_op_modrdn_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
388 slapi_pblock_set( pb, SLAPI_MODRDN_NEWRDN, (void *)op->orr_newrdn.bv_val );
389 slapi_pblock_set( pb, SLAPI_MODRDN_NEWSUPERIOR, (void *)op->orr_newSup->bv_val );
390 slapi_pblock_set( pb, SLAPI_MODRDN_DELOLDRDN, (void *)op->orr_deleteoldrdn );
396 slapi_op_search_init( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
400 attrs = anlist2charray_x( op->ors_attrs, 0, op->o_tmpmemctx );
402 slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, (void *)op->ors_scope );
403 slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, (void *)op->ors_deref );
404 slapi_pblock_set( pb, SLAPI_SEARCH_SIZELIMIT, (void *)op->ors_slimit );
405 slapi_pblock_set( pb, SLAPI_SEARCH_TIMELIMIT, (void *)op->ors_tlimit );
406 slapi_pblock_set( pb, SLAPI_SEARCH_FILTER, (void *)op->ors_filter );
407 slapi_pblock_set( pb, SLAPI_SEARCH_STRFILTER, (void *)op->ors_filterstr.bv_val );
408 slapi_pblock_set( pb, SLAPI_SEARCH_ATTRS, (void *)attrs );
409 slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, (void *)op->ors_attrsonly );
415 slapi_op_search_callback( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
417 /* check preoperation result code */
418 if ( rs->sr_err < 0 ) {
419 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
423 if ( slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN, pb ) != 0 ) {
428 * The plugin can set the SLAPI_SEARCH_FILTER.
429 * SLAPI_SEARCH_STRFILER is not normative.
431 slapi_pblock_get( pb, SLAPI_SEARCH_FILTER, (void *)&op->ors_filter );
432 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
433 filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
435 slapi_pblock_get( pb, SLAPI_SEARCH_TARGET, (void **)&op->o_req_dn.bv_val );
436 op->o_req_dn.bv_len = strlen( op->o_req_dn.bv_val );
438 if( !BER_BVISNULL( &op->o_req_ndn ) ) {
439 slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
441 rs->sr_err = dnNormalize( 0, NULL, NULL, &op->o_req_dn, &op->o_req_ndn,
443 if ( rs->sr_err != LDAP_SUCCESS ) {
444 send_ldap_result( op, rs );
448 slapi_pblock_get( pb, SLAPI_SEARCH_SCOPE, (void **)&op->ors_scope );
449 slapi_pblock_get( pb, SLAPI_SEARCH_DEREF, (void **)&op->ors_deref );
455 slapi_op_search_cleanup( Operation *op, SlapReply *rs, Slapi_PBlock *pb )
459 slapi_pblock_get( pb, SLAPI_SEARCH_ATTRS, (void *)&attrs );
462 op->o_tmpfree( attrs, op->o_tmpmemctx );
467 typedef int (slapi_over_callback)( Operation *, SlapReply *rs, Slapi_PBlock * );
469 struct slapi_op_info {
472 slapi_over_callback *soi_preop_init;
473 slapi_over_callback *soi_callback;
474 slapi_over_callback *soi_postop_init;
475 slapi_over_callback *soi_cleanup;
476 } slapi_op_dispatch_table[] = {
478 SLAPI_PLUGIN_PRE_BIND_FN,
479 SLAPI_PLUGIN_POST_BIND_FN,
480 slapi_op_bind_preop_init,
481 slapi_op_bind_callback,
482 slapi_op_bind_postop_init,
486 SLAPI_PLUGIN_PRE_UNBIND_FN, /* UNBIND */
487 SLAPI_PLUGIN_POST_UNBIND_FN,
494 SLAPI_PLUGIN_PRE_SEARCH_FN,
495 SLAPI_PLUGIN_POST_SEARCH_FN,
496 slapi_op_search_init,
497 slapi_op_search_callback,
499 slapi_op_search_cleanup
502 SLAPI_PLUGIN_PRE_COMPARE_FN,
503 SLAPI_PLUGIN_POST_COMPARE_FN,
504 slapi_op_compare_init,
510 SLAPI_PLUGIN_PRE_MODIFY_FN,
511 SLAPI_PLUGIN_POST_MODIFY_FN,
512 slapi_op_modify_init,
513 slapi_op_modify_callback,
515 slapi_op_modify_cleanup
518 SLAPI_PLUGIN_PRE_MODRDN_FN,
519 SLAPI_PLUGIN_POST_MODRDN_FN,
520 slapi_op_modrdn_init,
526 SLAPI_PLUGIN_PRE_ADD_FN,
527 SLAPI_PLUGIN_POST_ADD_FN,
534 SLAPI_PLUGIN_PRE_DELETE_FN,
535 SLAPI_PLUGIN_POST_DELETE_FN,
542 SLAPI_PLUGIN_PRE_ABANDON_FN,
543 SLAPI_PLUGIN_POST_ABANDON_FN,
560 slapi_tag2op( ber_tag_t tag )
571 case LDAP_REQ_DELETE:
574 case LDAP_REQ_MODRDN:
577 case LDAP_REQ_MODIFY:
580 case LDAP_REQ_COMPARE:
583 case LDAP_REQ_SEARCH:
586 case LDAP_REQ_UNBIND:
598 slapi_op_response( Operation *op, SlapReply *rs )
602 switch ( rs->sr_type ) {
604 rc = slapi_over_result( op, rs, SLAPI_PLUGIN_PRE_RESULT_FN );
607 rc = slapi_over_search( op, rs, SLAPI_PLUGIN_PRE_ENTRY_FN );
610 rc = slapi_over_search( op, rs, SLAPI_PLUGIN_PRE_REFERRAL_FN );
613 rc = SLAP_CB_CONTINUE;
621 slapi_op_cleanup( Operation *op, SlapReply *rs )
625 switch ( rs->sr_type ) {
627 rc = slapi_over_result( op, rs, SLAPI_PLUGIN_POST_RESULT_FN );
630 rc = slapi_over_search( op, rs, SLAPI_PLUGIN_POST_ENTRY_FN );
633 rc = slapi_over_search( op, rs, SLAPI_PLUGIN_POST_REFERRAL_FN );
636 rc = SLAP_CB_CONTINUE;
644 slapi_op_func( Operation *op, SlapReply *rs )
646 Slapi_PBlock *pb = op->o_pb;
647 slap_operation_t which;
648 struct slapi_op_info *opinfo;
655 * We check for op->o_extensions to verify that we are not
656 * processing a SLAPI internal operation. XXX
658 if ( op->o_pb == NULL || op->o_extensions == NULL ) {
659 return SLAP_CB_CONTINUE;
663 * Find the SLAPI operation information for this LDAP
664 * operation; this will contain the preop and postop
665 * plugin types, as well as any additional information
666 * we need to complete.
668 which = slapi_tag2op( op->o_tag );
669 if ( which >= op_last ) {
670 return SLAP_CB_CONTINUE;
673 opinfo = &slapi_op_dispatch_table[which];
674 if ( opinfo == NULL || opinfo->soi_preop == 0 ) {
675 return SLAP_CB_CONTINUE;
678 slapi_int_pblock_set_operation( pb, op );
680 cb.sc_response = slapi_op_response;
681 cb.sc_cleanup = slapi_op_cleanup;
682 cb.sc_private = opinfo;
683 cb.sc_next = op->o_callback;
684 op->o_callback = &cb;
687 * Call preoperation plugins
689 if ( opinfo->soi_preop_init != NULL ) {
690 rs->sr_err = (opinfo->soi_preop_init)( op, rs, pb );
691 if ( rs->sr_err != LDAP_SUCCESS )
695 rs->sr_err = slapi_int_call_plugins( op->o_bd, opinfo->soi_preop, pb );
698 * soi_callback is responsible for examining the result code
699 * of the preoperation plugin and determining whether to
700 * abort. This is needed because of special SLAPI behaviour
701 * with bind preoperation plugins.
703 * The soi_callback function is also used to reset any values
704 * returned from the preoperation plugin before calling the
705 * backend (for the success case).
707 if ( opinfo->soi_callback == NULL ) {
708 if ( rs->sr_err < 0 ) {
709 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rs->sr_err );
713 rc = (opinfo->soi_callback)( op, rs, pb );
719 * Call actual backend (or next overlay in stack)
721 on = (slap_overinst *)op->o_bd->bd_info;
724 rs->sr_err = overlay_op_walk( op, rs, which, oi, on->on_next );
727 * Call postoperation plugins
729 slapi_pblock_set( pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
731 if ( opinfo->soi_postop_init != NULL ) {
732 (opinfo->soi_postop_init)( op, rs, pb );
735 slapi_int_call_plugins( op->o_bd, opinfo->soi_postop, pb );
738 if ( opinfo->soi_cleanup != NULL ) {
739 (opinfo->soi_cleanup)( op, rs, pb );
742 op->o_callback = cb.sc_next;
748 slapi_over_extended( Operation *op, SlapReply *rs )
750 Slapi_PBlock *pb = op->o_pb;
754 struct berval reqdata = BER_BVNULL;
756 slapi_int_get_extop_plugin( &op->ore_reqoid, &callback );
757 if ( callback == NULL ) {
758 return SLAP_CB_CONTINUE;
761 slapi_int_pblock_set_operation( pb, op );
763 if ( op->ore_reqdata != NULL ) {
764 reqdata = *op->ore_reqdata;
767 slapi_pblock_set( pb, SLAPI_EXT_OP_REQ_OID, (void *)op->ore_reqoid.bv_val);
768 slapi_pblock_set( pb, SLAPI_EXT_OP_REQ_VALUE, (void *)&reqdata);
770 rc = (*callback)( pb );
771 if ( rc == SLAPI_PLUGIN_EXTENDED_SENT_RESULT ) {
773 } else if ( rc == SLAPI_PLUGIN_EXTENDED_NOT_HANDLED ) {
774 return SLAP_CB_CONTINUE;
777 slapi_pblock_get( pb, SLAPI_EXT_OP_RET_OID, (void **)&rs->sr_rspoid );
778 slapi_pblock_get( pb, SLAPI_EXT_OP_RET_VALUE, (void **)&rs->sr_rspdata );
781 send_ldap_extended( op, rs );
783 if ( rs->sr_rspoid != NULL )
784 slapi_ch_free_string( (char **)&rs->sr_rspoid );
786 if ( rs->sr_rspdata != NULL )
787 ber_bvfree( rs->sr_rspdata );
793 slapi_over_access_allowed(
796 AttributeDescription *desc,
798 slap_access_t access,
799 AccessControlState *state,
804 rc = slapi_int_access_allowed( op, e, desc, val, access, state );
806 rc = SLAP_CB_CONTINUE;
812 slapi_over_acl_group(
815 struct berval *gr_ndn,
816 struct berval *op_ndn,
817 ObjectClass *group_oc,
818 AttributeDescription *group_at )
822 Slapi_PBlock *pb = op->o_pb;
825 return SLAP_CB_CONTINUE;
828 rc = be_entry_get_rw( op, gr_ndn, group_oc, group_at, 0, &e );
830 return SLAP_CB_CONTINUE;
833 slapi_pblock_set( pb, SLAPI_X_GROUP_ENTRY, (void *)e );
834 slapi_pblock_set( pb, SLAPI_X_GROUP_OPERATION_DN, (void *)op_ndn->bv_val );
835 slapi_pblock_set( pb, SLAPI_X_GROUP_ATTRIBUTE, (void *)group_at->ad_cname.bv_val );
836 slapi_pblock_set( pb, SLAPI_X_GROUP_TARGET_ENTRY, (void *)target );
838 rc = slapi_int_call_plugins( op->o_bd, SLAPI_X_PLUGIN_PRE_GROUP_FN, pb );
840 rc = SLAP_CB_CONTINUE;
842 slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void **)&rc );
844 slapi_pblock_set( pb, SLAPI_X_GROUP_ENTRY, NULL );
845 slapi_pblock_set( pb, SLAPI_X_GROUP_OPERATION_DN, NULL );
846 slapi_pblock_set( pb, SLAPI_X_GROUP_ATTRIBUTE, NULL );
847 slapi_pblock_set( pb, SLAPI_X_GROUP_TARGET_ENTRY, NULL );
850 be_entry_release_r( op, e );
853 * XXX don't call POST_GROUP_FN, I have no idea what the point of
854 * that plugin function was anyway
861 slapi_over_compute_output_attr_access(computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e)
863 struct berval *nval = (struct berval *)c->cac_private;
865 return access_allowed( c->cac_op, e, a->a_desc, nval, ACL_AUTH, NULL ) == 0;
869 slapi_over_acl_attribute(
872 struct berval *entry_ndn,
873 AttributeDescription *entry_at,
875 slap_access_t access )
877 computed_attr_context ctx;
879 ctx.cac_pb = op->o_pb;
881 ctx.cac_acl_state = NULL;
882 ctx.cac_private = nval;
887 slapi_int_overlay_init()
889 memset( &slapi, 0, sizeof(slapi) );
891 slapi.on_bi.bi_type = SLAPI_OVERLAY_NAME;
893 slapi.on_bi.bi_op_bind = slapi_op_func;
894 slapi.on_bi.bi_op_unbind = slapi_op_func;
895 slapi.on_bi.bi_op_search = slapi_op_func;
896 slapi.on_bi.bi_op_compare = slapi_op_func;
897 slapi.on_bi.bi_op_modify = slapi_op_func;
898 slapi.on_bi.bi_op_modrdn = slapi_op_func;
899 slapi.on_bi.bi_op_add = slapi_op_func;
900 slapi.on_bi.bi_op_delete = slapi_op_func;
901 slapi.on_bi.bi_op_abandon = slapi_op_func;
902 slapi.on_bi.bi_op_cancel = slapi_op_func;
904 slapi.on_bi.bi_extended = slapi_over_extended;
905 slapi.on_bi.bi_access_allowed = slapi_over_access_allowed;
906 slapi.on_bi.bi_operational = slapi_over_aux_operational;
908 return overlay_register( &slapi );
911 #endif /* LDAP_SLAPI */