- attrs_free( aa );
- goto error_return;
- }
- }
-
-#ifdef LDAP_SLAPI
- /*
- * First, setup the computed attribute context that is
- * passed to all plugins.
- */
- if ( op->o_pb ) {
- ctx.cac_pb = op->o_pb;
- ctx.cac_attrs = rs->sr_attrs;
- ctx.cac_attrsonly = op->ors_attrsonly;
- ctx.cac_userattrs = userattrs;
- ctx.cac_opattrs = opattrs;
- ctx.cac_acl_state = acl_state;
- ctx.cac_private = (void *)ber;
-
- /*
- * For each client requested attribute, call the plugins.
- */
- if ( rs->sr_attrs != NULL ) {
- for ( anp = rs->sr_attrs; anp->an_name.bv_val != NULL; anp++ ) {
- rc = compute_evaluator( &ctx, anp->an_name.bv_val,
- rs->sr_entry, slapi_int_compute_output_ber );
- if ( rc == 1 ) break;
- }
- } else {
- /*
- * Technically we shouldn't be returning operational attributes
- * when the user requested only user attributes. We'll let the
- * plugin decide whether to be naughty or not.
- */
- rc = compute_evaluator( &ctx, "*",
- rs->sr_entry, slapi_int_compute_output_ber );
- }
- if ( rc == 1 ) {
- if ( op->o_res_ber == NULL ) ber_free_buf( ber );
- send_ldap_error( op, rs, LDAP_OTHER, "computed attribute error" );