Lines Matching refs:op
150 translucent_cfadd( Operation *op, SlapReply *rs, Entry *e, ConfigArgs *ca )
173 config_build_entry( op, rs, cei, ca, &bv,
193 if ( c->op == SLAP_CONFIG_EMIT ) {
200 } else if ( c->op == LDAP_MOD_DELETE ) {
236 void glue_parent(Operation *op) {
237 Operation nop = *op;
238 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
244 dnParent( &op->o_req_ndn, &pdn );
245 ber_dupbv_x( &ndn, &pdn, op->o_tmpmemctx );
281 op->o_tmpfree( ndn.bv_val, op->o_tmpmemctx );
309 static int translucent_add(Operation *op, SlapReply *rs) {
310 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
313 op->o_req_dn.bv_val, 0, 0);
314 if(!be_isroot(op)) {
315 op->o_bd->bd_info = (BackendInfo *) on->on_info;
316 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
318 op->o_bd->bd_info = (BackendInfo *) on;
321 if(!ov->no_glue) glue_parent(op);
333 static int translucent_modrdn(Operation *op, SlapReply *rs) {
334 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
337 op->o_req_dn.bv_val, op->orr_newrdn.bv_val, 0);
338 if(!be_isroot(op)) {
339 op->o_bd->bd_info = (BackendInfo *) on->on_info;
340 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
342 op->o_bd->bd_info = (BackendInfo *) on;
346 op->o_tag = LDAP_REQ_ADD;
347 glue_parent(op);
348 op->o_tag = LDAP_REQ_MODRDN;
360 static int translucent_delete(Operation *op, SlapReply *rs) {
361 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
363 op->o_req_dn.bv_val, 0, 0);
364 if(!be_isroot(op)) {
365 op->o_bd->bd_info = (BackendInfo *) on->on_info;
366 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
368 op->o_bd->bd_info = (BackendInfo *) on;
375 translucent_tag_cb( Operation *op, SlapReply *rs )
377 op->o_tag = LDAP_REQ_MODIFY;
378 op->orm_modlist = op->o_callback->sc_private;
379 rs->sr_tag = slap_req2res( op->o_tag );
392 static int translucent_modify(Operation *op, SlapReply *rs) {
395 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
405 op->o_req_dn.bv_val, 0, 0);
408 send_ldap_error(op, rs, LDAP_UNAVAILABLE,
419 db = op->o_bd;
420 op->o_bd = &ov->db;
421 ov->db.be_acl = op->o_bd->be_acl;
422 rc = ov->db.bd_info->bi_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &re);
424 send_ldap_error((op), rs, LDAP_NO_SUCH_OBJECT,
428 op->o_bd = db;
442 op->o_bd->bd_info = (BackendInfo *) on->on_info;
443 rc = be_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &e);
444 op->o_bd->bd_info = (BackendInfo *) on;
448 for(mm = &op->orm_modlist; *mm; ) {
483 op->o_bd = &ov->db;
484 ov->db.bd_info->bi_entry_release_rw(op, re, 0);
485 op->o_bd = db;
489 op->o_bd->bd_info = (BackendInfo *) on->on_info;
490 be_entry_release_r(op, e);
491 op->o_bd->bd_info = (BackendInfo *) on;
495 send_ldap_error(op, rs, erc,
504 op->o_bd = &ov->db;
505 ov->db.bd_info->bi_entry_release_rw(op, re, 0);
506 op->o_bd = db;
524 for(del = 0, ax = NULL, m = op->orm_modlist; m; m = m->sml_next) {
546 send_ldap_error(op, rs, LDAP_CONSTRAINT_VIOLATION,
553 send_ldap_error(op, rs, LDAP_CONSTRAINT_VIOLATION,
559 send_ldap_result(op, rs);
564 ber_dupbv( &e->e_name, &op->o_req_dn );
565 ber_dupbv( &e->e_nname, &op->o_req_ndn );
568 op->o_tag = LDAP_REQ_ADD;
570 cb.sc_private = op->orm_modlist;
571 op->oq_add.rs_e = e;
573 glue_parent(op);
575 cb.sc_next = op->o_callback;
576 op->o_callback = &cb;
577 rc = on->on_info->oi_orig->bi_op_add(op, &nrs);
578 if ( op->ora_e == e )
580 op->o_callback = cb.sc_next;
585 static int translucent_compare(Operation *op, SlapReply *rs) {
586 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
588 AttributeAssertion *ava = op->orc_ava;
594 op->o_req_dn.bv_val, ava->aa_desc->ad_cname.bv_val, ava->aa_value.bv_val);
601 rc = overlay_entry_get_ov(op, &op->o_req_ndn, NULL, ava->aa_desc, 0, &e, on);
603 overlay_entry_release_ov(op, e, 0, on);
608 send_ldap_error(op, rs, LDAP_UNAVAILABLE,
617 db = op->o_bd;
618 op->o_bd = &ov->db;
619 ov->db.be_acl = op->o_bd->be_acl;
620 rc = ov->db.bd_info->bi_op_compare(op, rs);
621 op->o_bd = db;
626 static int translucent_pwmod(Operation *op, SlapReply *rs) {
630 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
649 db = op->o_bd;
650 op->o_bd = &ov->db;
651 ov->db.be_acl = op->o_bd->be_acl;
652 rc = ov->db.bd_info->bi_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &re);
654 send_ldap_error((op), rs, LDAP_NO_SUCH_OBJECT,
658 op->o_bd = db;
665 op->o_bd->bd_info = (BackendInfo *) on->on_info;
666 rc = be_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &e);
667 op->o_bd->bd_info = (BackendInfo *) on;
672 op->o_bd = &ov->db;
673 ov->db.bd_info->bi_entry_release_rw(op, re, 0);
674 op->o_bd = db;
679 op->o_bd->bd_info = (BackendInfo *) on->on_info;
680 be_entry_release_r(op, e);
681 op->o_bd->bd_info = (BackendInfo *) on;
688 op->o_bd = &ov->db;
689 ov->db.bd_info->bi_entry_release_rw(op, re, 0);
690 op->o_bd = db;
701 ber_dupbv( &e->e_name, &op->o_req_dn );
702 ber_dupbv( &e->e_nname, &op->o_req_ndn );
705 nop = *op;
725 static int translucent_exop(Operation *op, SlapReply *rs) {
726 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
731 op->o_req_dn.bv_val, 0, 0);
734 send_ldap_error(op, rs, LDAP_UNAVAILABLE,
739 if ( bvmatch( &bv_exop_pwmod, &op->ore_reqoid ) ) {
740 return translucent_pwmod( op, rs );
775 static int translucent_search_cb(Operation *op, SlapReply *rs) {
785 tc = op->o_callback->sc_private;
787 /* Don't let the op complete while we're gathering data */
791 if(!op || !rs || rs->sr_type != REP_SEARCH || !rs->sr_entry)
797 op->ors_slimit = tc->slimit + ( tc->slimit > 0 ? 1 : 0 );
798 if ( op->ors_attrs == slap_anlist_all_attributes ) {
799 op->ors_attrs = tc->attrs;
807 db = op->o_bd;
817 rs_flush_entry( op, rs, on );
818 rc = test_filter( op, re, tc->orig );
835 op->o_bd = &ov->db;
836 rc = be_entry_get_rw( op, &rs->sr_entry->e_nname, NULL, NULL, 0, &re );
839 be_entry_release_r( op, re );
845 op->o_bd = tc->db;
847 rc = overlay_entry_get_ov(op, &rs->sr_entry->e_nname, NULL, NULL, 0, &le, on);
850 rs_flush_entry( op, rs, on );
890 rs_flush_entry(op, rs, on);
892 overlay_entry_release_ov(op, le, 0, on);
914 rc = test_filter( op, rs->sr_entry, tc->orig );
933 rc = test_filter( op, rs->sr_entry, tc->orig );
946 op->o_bd = db;
957 trans_filter_dup(Operation *op, Filter *f, AttributeName *an)
966 n = op->o_tmpalloc( sizeof(Filter), op->o_tmpmemctx );
974 n = op->o_tmpalloc( sizeof(Filter), op->o_tmpmemctx );
988 n = op->o_tmpalloc( sizeof(Filter), op->o_tmpmemctx );
1000 n = op->o_tmpalloc( sizeof(Filter), op->o_tmpmemctx );
1005 *p = trans_filter_dup( op, f, an );
1012 op->o_tmpfree( n, op->o_tmpmemctx );
1020 op->o_tmpfree( f, op->o_tmpmemctx );
1029 trans_filter_free( Operation *op, Filter *f )
1048 trans_filter_free( op, p );
1054 op->o_tmpfree( f, op->o_tmpmemctx );
1064 static int translucent_search(Operation *op, SlapReply *rs) {
1065 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
1074 op->o_req_dn.bv_val, op->ors_filterstr.bv_val, 0);
1077 send_ldap_error(op, rs, LDAP_UNAVAILABLE,
1082 fr = ov->remote ? trans_filter_dup( op, op->ors_filter, ov->remote ) : NULL;
1083 fl = ov->local ? trans_filter_dup( op, op->ors_filter, ov->local ) : NULL;
1086 cb.sc_next = op->o_callback;
1088 ov->db.be_acl = op->o_bd->be_acl;
1089 tc.db = op->o_bd;
1091 tc.orig = op->ors_filter;
1094 tc.slimit = op->ors_slimit;
1096 fbv = op->ors_filterstr;
1098 op->o_callback = &cb;
1101 tc.attrs = op->ors_attrs;
1102 op->ors_slimit = SLAP_NO_LIMIT;
1103 op->ors_attrs = slap_anlist_all_attributes;
1104 op->o_bd = &ov->db;
1108 op->ors_filter = fr;
1109 filter2bv_x( op, fr, &op->ors_filterstr );
1111 rc = ov->db.bd_info->bi_op_search(op, rs);
1112 op->ors_attrs = tc.attrs;
1113 op->o_bd = tc.db;
1115 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
1120 op->ors_filter = fl;
1121 filter2bv_x( op, fl, &op->ors_filterstr );
1122 rc = overlay_op_walk( op, rs, op_search, on->on_info, on->on_next );
1123 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
1125 op->ors_filterstr = fbv;
1126 op->ors_filter = tc.orig;
1127 op->o_callback = cb.sc_next;
1128 rs->sr_attrs = op->ors_attrs;
1140 test_filter( op, rs->sr_entry, op->ors_filter ))
1143 rc = send_search_entry( op, rs );
1153 send_ldap_result( op, rs );
1156 op->ors_slimit = tc.slimit;
1160 trans_filter_free( op, fl );
1162 trans_filter_free( op, fr );
1174 static int translucent_bind(Operation *op, SlapReply *rs) {
1175 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
1182 op->o_req_dn.bv_val, op->orb_method, 0);
1185 send_ldap_error(op, rs, LDAP_UNAVAILABLE,
1192 save_cb = op->o_callback;
1193 op->o_callback = ≻
1196 db = op->o_bd;
1197 op->o_bd = &ov->db;
1198 ov->db.be_acl = op->o_bd->be_acl;
1199 rc = ov->db.bd_info->bi_op_bind(op, rs);
1200 op->o_bd = db;
1203 op->o_callback = save_cb;