Lines Matching refs:op
52 rwm_send_entry( Operation *op, SlapReply *rs );
55 rwm_op_rollback( Operation *op, SlapReply *rs, rwm_op_state *ros )
71 op->o_req_dn = ros->ro_dn;
74 op->o_req_ndn = ros->ro_ndn;
100 if ( op->orc_ava->aa_value.bv_val != ros->orc_ava->aa_value.bv_val )
101 op->o_tmpfree( op->orc_ava->aa_value.bv_val, op->o_tmpmemctx );
102 op->orc_ava = ros->orc_ava;
105 slap_mods_free( op->orm_modlist, 1 );
106 op->orm_modlist = ros->orm_modlist;
109 if ( op->orr_newSup != ros->orr_newSup ) {
110 ch_free( op->orr_newSup->bv_val );
111 ch_free( op->orr_nnewSup->bv_val );
112 op->o_tmpfree( op->orr_newSup, op->o_tmpmemctx );
113 op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
114 op->orr_newSup = ros->orr_newSup;
115 op->orr_nnewSup = ros->orr_nnewSup;
117 if ( op->orr_newrdn.bv_val != ros->orr_newrdn.bv_val ) {
118 ch_free( op->orr_newrdn.bv_val );
119 ch_free( op->orr_nnewrdn.bv_val );
120 op->orr_newrdn = ros->orr_newrdn;
121 op->orr_nnewrdn = ros->orr_nnewrdn;
125 op->o_tmpfree( ros->mapped_attrs, op->o_tmpmemctx );
126 filter_free_x( op, op->ors_filter, 1 );
127 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
128 op->ors_attrs = ros->ors_attrs;
129 op->ors_filter = ros->ors_filter;
130 op->ors_filterstr = ros->ors_filterstr;
133 if ( op->ore_reqdata != ros->ore_reqdata ) {
134 ber_bvfree( op->ore_reqdata );
135 op->ore_reqdata = ros->ore_reqdata;
141 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
144 op->o_conn->c_ndn.bv_val,
145 op->o_req_ndn.bv_val );
146 ber_bvreplace( &op->o_conn->c_ndn,
147 &op->o_req_ndn );
148 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
157 rwm_op_cleanup( Operation *op, SlapReply *rs )
159 slap_callback *cb = op->o_callback;
163 op->o_abandon || rs->sr_err == SLAPD_ABANDON )
165 rwm_op_rollback( op, rs, ros );
167 op->o_callback = op->o_callback->sc_next;
168 op->o_tmpfree( cb, op->o_tmpmemctx );
175 rwm_callback_get( Operation *op )
179 roc = op->o_tmpalloc( sizeof( struct rwm_op_cb ), op->o_tmpmemctx );
182 roc->cb.sc_next = op->o_callback;
184 roc->ros.r_tag = op->o_tag;
185 roc->ros.ro_dn = op->o_req_dn;
186 roc->ros.ro_ndn = op->o_req_ndn;
192 roc->ros.o_request = op->o_request;
199 rwm_op_dn_massage( Operation *op, SlapReply *rs, void *cookie,
202 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
215 dc.conn = op->o_conn;
220 * and the caller sets op->o_req_dn = op->o_req_ndn,
221 * only rewrite the op->o_req_ndn and use it as
222 * op->o_req_dn as well */
223 ndn = op->o_req_ndn;
224 if ( op->o_req_dn.bv_val != op->o_req_ndn.bv_val ) {
225 dn = op->o_req_dn;
226 rc = rwm_dn_massage_pretty_normalize( &dc, &op->o_req_dn, &dn, &ndn );
228 rc = rwm_dn_massage_normalize( &dc, &op->o_req_ndn, &ndn );
235 if ( ( op->o_req_dn.bv_val != op->o_req_ndn.bv_val && dn.bv_val == op->o_req_dn.bv_val )
236 || ndn.bv_val == op->o_req_ndn.bv_val )
241 if ( op->o_req_dn.bv_val != op->o_req_ndn.bv_val ) {
242 op->o_req_dn = dn;
246 op->o_req_dn = ndn;
248 op->o_req_ndn = ndn;
261 rwm_op_add( Operation *op, SlapReply *rs )
263 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
270 char *olddn = op->o_req_dn.bv_val;
273 rwm_op_cb *roc = rwm_callback_get( op );
275 rc = rwm_op_dn_massage( op, rs, "addDN", &roc->ros );
277 op->o_bd->bd_info = (BackendInfo *)on->on_info;
278 send_ldap_error( op, rs, rc, "addDN massage error" );
282 if ( olddn != op->o_req_dn.bv_val ) {
283 ber_bvreplace( &op->ora_e->e_name, &op->o_req_dn );
284 ber_bvreplace( &op->ora_e->e_nname, &op->o_req_ndn );
288 isupdate = be_shadow_update( op );
289 for ( i = 0, ap = &op->oq_add.rs_e->e_attrs; *ap; ) {
325 } else if ( !isupdate && !get_relax( op ) && (*ap)->a_desc->ad_type->sat_no_user_mod )
347 rc = rwm_dnattr_rewrite( op, rs, "addAttrDN",
355 rc = rwm_referral_rewrite( op, rs, "referralAttrDN",
381 op->o_callback = &roc->cb;
411 rwm_op_bind( Operation *op, SlapReply *rs )
413 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
416 rwm_op_cb *roc = rwm_callback_get( op );
418 rc = rwm_op_dn_massage( op, rs, "bindDN", &roc->ros );
420 op->o_bd->bd_info = (BackendInfo *)on->on_info;
421 send_ldap_error( op, rs, rc, "bindDN massage error" );
425 overlay_callback_after_backover( op, &roc->cb, 1 );
431 rwm_op_unbind( Operation *op, SlapReply *rs )
433 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
437 rewrite_session_delete( rwmap->rwm_rw, op->o_conn );
443 rwm_op_compare( Operation *op, SlapReply *rs )
445 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
452 rwm_op_cb *roc = rwm_callback_get( op );
454 rc = rwm_op_dn_massage( op, rs, "compareDN", &roc->ros );
456 op->o_bd->bd_info = (BackendInfo *)on->on_info;
457 send_ldap_error( op, rs, rc, "compareDN massage error" );
462 if ( op->orc_ava->aa_desc == slap_schema.si_ad_objectClass
463 || op->orc_ava->aa_desc == slap_schema.si_ad_structuralObjectClass )
465 rwm_map( &rwmap->rwm_oc, &op->orc_ava->aa_value,
469 op->o_bd->bd_info = (BackendInfo *)on->on_info;
470 send_ldap_error( op, rs, LDAP_OTHER, "compare objectClass map error" );
473 } else if ( mapped_vals[0].bv_val != op->orc_ava->aa_value.bv_val ) {
474 ber_dupbv_x( &op->orc_ava->aa_value, &mapped_vals[0],
475 op->o_tmpmemctx );
480 AttributeDescription *ad = op->orc_ava->aa_desc;
482 ( void )rwm_mapping( &rwmap->rwm_at, &op->orc_ava->aa_desc->ad_cname,
486 op->o_bd->bd_info = (BackendInfo *)on->on_info;
487 send_ldap_error( op, rs, LDAP_OTHER, "compare attributeType map error" );
496 if ( op->orc_ava->aa_desc->ad_type->sat_syntax == slap_schema.si_syn_distinguishedName
504 mapped_vals[0] = op->orc_ava->aa_value;
506 rc = rwm_dnattr_rewrite( op, rs, "compareAttrDN", NULL, mapped_valsp );
509 op->o_bd->bd_info = (BackendInfo *)on->on_info;
510 send_ldap_error( op, rs, rc, "compareAttrDN massage error" );
514 if ( mapped_vals[ 0 ].bv_val != op->orc_ava->aa_value.bv_val ) {
518 ber_dupbv_x( &op->orc_ava->aa_value, &mapped_vals[0],
519 op->o_tmpmemctx );
523 op->orc_ava->aa_desc = ad;
526 op->o_callback = &roc->cb;
532 rwm_op_delete( Operation *op, SlapReply *rs )
534 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
537 rwm_op_cb *roc = rwm_callback_get( op );
539 rc = rwm_op_dn_massage( op, rs, "deleteDN", &roc->ros );
541 op->o_bd->bd_info = (BackendInfo *)on->on_info;
542 send_ldap_error( op, rs, rc, "deleteDN massage error" );
546 op->o_callback = &roc->cb;
552 rwm_op_modify( Operation *op, SlapReply *rs )
554 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
562 rwm_op_cb *roc = rwm_callback_get( op );
564 rc = rwm_op_dn_massage( op, rs, "modifyDN", &roc->ros );
566 op->o_bd->bd_info = (BackendInfo *)on->on_info;
567 send_ldap_error( op, rs, rc, "modifyDN massage error" );
571 isupdate = be_shadow_update( op );
572 for ( mlp = &op->orm_modlist; *mlp; ) {
583 } else if ( !isupdate && !get_relax( op ) && ml->sml_desc->ad_type->sat_no_user_mod )
669 rc = rwm_dnattr_rewrite( op, rs, "modifyAttrDN",
674 rc = rwm_referral_rewrite( op, rs,
710 op->o_callback = &roc->cb;
716 rwm_op_modrdn( Operation *op, SlapReply *rs )
718 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
725 rwm_op_cb *roc = rwm_callback_get( op );
727 if ( op->orr_newSup ) {
735 dc.conn = op->o_conn;
738 newSup = *op->orr_newSup;
739 nnewSup = *op->orr_nnewSup;
740 rc = rwm_dn_massage_pretty_normalize( &dc, op->orr_newSup, &newSup, &nnewSup );
742 op->o_bd->bd_info = (BackendInfo *)on->on_info;
743 send_ldap_error( op, rs, rc, "newSuperiorDN massage error" );
747 if ( op->orr_newSup->bv_val != newSup.bv_val ) {
748 op->orr_newSup = op->o_tmpalloc( sizeof( struct berval ),
749 op->o_tmpmemctx );
750 op->orr_nnewSup = op->o_tmpalloc( sizeof( struct berval ),
751 op->o_tmpmemctx );
752 *op->orr_newSup = newSup;
753 *op->orr_nnewSup = nnewSup;
765 dc.conn = op->o_conn;
768 newrdn = op->orr_newrdn;
769 nnewrdn = op->orr_nnewrdn;
770 rc = rwm_dn_massage_pretty_normalize( &dc, &op->orr_newrdn, &newrdn, &nnewrdn );
772 op->o_bd->bd_info = (BackendInfo *)on->on_info;
773 send_ldap_error( op, rs, rc, "newRDN massage error" );
777 if ( op->orr_newrdn.bv_val != newrdn.bv_val ) {
778 op->orr_newrdn = newrdn;
779 op->orr_nnewrdn = nnewrdn;
786 rc = rwm_op_dn_massage( op, rs, "renameDN", &roc->ros );
788 op->o_bd->bd_info = (BackendInfo *)on->on_info;
789 send_ldap_error( op, rs, rc, "renameDN massage error" );
793 op->o_callback = &roc->cb;
799 if ( op->orr_newSup != roc->ros.orr_newSup ) {
800 ch_free( op->orr_newSup->bv_val );
801 ch_free( op->orr_nnewSup->bv_val );
802 op->o_tmpfree( op->orr_newSup, op->o_tmpmemctx );
803 op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
804 op->orr_newSup = roc->ros.orr_newSup;
805 op->orr_nnewSup = roc->ros.orr_nnewSup;
808 if ( op->orr_newrdn.bv_val != roc->ros.orr_newrdn.bv_val ) {
809 ch_free( op->orr_newrdn.bv_val );
810 ch_free( op->orr_nnewrdn.bv_val );
811 op->orr_newrdn = roc->ros.orr_newrdn;
812 op->orr_nnewrdn = roc->ros.orr_nnewrdn;
821 rwm_swap_attrs( Operation *op, SlapReply *rs )
823 slap_callback *cb = op->o_callback;
828 /* other overlays might have touched op->ors_attrs,
831 op->ors_attrs = ros->mapped_attrs;
846 rwm_entry_release_rw( Operation *op, Entry *e, int rw )
848 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
865 rwm_entry_get_rw( Operation *op, struct berval *ndn,
868 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
883 op2 = *op;
901 db = *op->o_bd;
928 op->o_tmpfree( ros.r_ndn.bv_val, op->o_tmpmemctx );
935 rwm_op_search( Operation *op, SlapReply *rs )
937 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
951 rwm_op_cb *roc = rwm_callback_get( op );
953 rc = rewrite_session_var_set( rwmap->rwm_rw, op->o_conn,
954 "searchFilter", op->ors_filterstr.bv_val );
956 rc = rwm_op_dn_massage( op, rs, "searchDN", &roc->ros );
966 dc.conn = op->o_conn;
970 rc = rwm_filter_map_rewrite( op, &dc, op->ors_filter, &fstr );
976 f = str2filter_x( op, fstr.bv_val );
983 op->ors_filter = f;
984 op->ors_filterstr = fstr;
986 rc = rwm_map_attrnames( op, &rwmap->rwm_at, &rwmap->rwm_oc,
987 op->ors_attrs, &an, RWM_MAP );
993 op->ors_attrs = an;
995 * the case that other overlays change op->ors_attrs */
999 op->o_callback = &roc->cb;
1009 filter_free_x( op, f, 1 );
1013 op->o_tmpfree( fstr.bv_val, op->o_tmpmemctx );
1016 rwm_op_rollback( op, rs, &roc->ros );
1017 op->oq_search = roc->ros.oq_search;
1018 op->o_tmpfree( roc, op->o_tmpmemctx );
1020 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1021 send_ldap_error( op, rs, rc, text );
1028 rwm_exop_passwd( Operation *op, SlapReply *rs )
1030 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
1039 if ( !BER_BVISNULL( &op->o_req_ndn ) ) {
1043 if ( !SLAP_ISGLOBALOVERLAY( op->o_bd ) ) {
1048 rs->sr_err = slap_passwd_parse( op->ore_reqdata, &id,
1057 rs->sr_err = dnPrettyNormal( NULL, &id, &op->o_req_dn,
1058 &op->o_req_ndn, op->o_tmpmemctx );
1066 ber_dupbv_x( &op->o_req_dn, &op->o_dn, op->o_tmpmemctx );
1067 ber_dupbv_x( &op->o_req_ndn, &op->o_ndn, op->o_tmpmemctx );
1070 roc = rwm_callback_get( op );
1072 rc = rwm_op_dn_massage( op, rs, "extendedDN", &roc->ros );
1074 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1075 send_ldap_error( op, rs, rc, "extendedDN massage error" );
1088 &op->o_req_dn );
1097 ber_flatten( ber, &op->ore_reqdata );
1100 op->o_callback = &roc->cb;
1114 rwm_extended( Operation *op, SlapReply *rs )
1116 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
1123 if ( bvmatch( &exop_table[i].oid, &op->oq_extended.rs_reqoid ) )
1125 rc = exop_table[i].extended( op, rs );
1135 send_ldap_result( op, rs );
1142 roc = rwm_callback_get( op );
1144 rc = rwm_op_dn_massage( op, rs, "extendedDN", &roc->ros );
1146 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1147 send_ldap_error( op, rs, rc, "extendedDN massage error" );
1152 op->o_callback = &roc->cb;
1158 rwm_matched( Operation *op, SlapReply *rs )
1160 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
1173 dc.conn = op->o_conn;
1195 rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first, int stripEntryDN )
1197 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
1211 dc.conn = op->o_conn;
1226 isupdate = be_shadow_update( op );
1234 op->ors_attrs != NULL &&
1236 !ad_inlist( (*ap)->a_desc, op->ors_attrs ) )
1307 && !get_relax( op )
1464 rwm_send_entry( Operation *op, SlapReply *rs )
1466 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
1482 dc.conn = op->o_conn;
1534 (void)rwm_attrs( op, rs, &e->e_attrs, 1 );
1541 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1542 be_entry_release_r( op, rs->sr_entry );
1543 op->o_bd->bd_info = (BackendInfo *)on;
1578 rwm_operational( Operation *op, SlapReply *rs )
1584 rwm_attrs( op, rs, &rs->sr_operational_attrs, 1 );
1591 /* don't use this; it cannot be reverted, and leaves op->o_req_dn
1595 rwm_chk_referrals( Operation *op, SlapReply *rs )
1597 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
1600 rc = rwm_op_dn_massage( op, rs, "referralCheckDN" );
1602 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1603 send_ldap_error( op, rs, rc, "referralCheckDN massage error" );
1728 rwm_response( Operation *op, SlapReply *rs )
1730 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
1736 if ( op->o_tag == LDAP_REQ_SEARCH && rs->sr_type == REP_SEARCH ) {
1737 return rwm_send_entry( op, rs );
1740 switch( op->o_tag ) {
1756 dc.conn = op->o_conn;
1767 rwm_matched( op, rs );
2086 if ( c->op == SLAP_CONFIG_EMIT ) {
2141 } else if ( c->op == LDAP_MOD_DELETE ) {