Lines Matching refs:op
195 memberof_isGroupOrMember_cb( Operation *op, SlapReply *rs )
200 mc = (memberof_cookie_t *)op->o_callback->sc_private;
212 memberof_saveMember_cb( Operation *op, SlapReply *rs )
218 mc = (memberof_cookie_t *)op->o_callback->sc_private;
226 ber_bvarray_dup_x( &mc->vals, a->a_nvals, op->o_tmpmemctx );
240 memberof_isGroupOrMember( Operation *op, memberof_cbinfo_t *mci )
245 Operation op2 = *op;
247 BackendInfo *bi = op->o_bd->bd_info;
256 if ( op->o_tag == LDAP_REQ_DELETE ) {
265 op2.o_dn = op->o_bd->be_rootdn;
266 op2.o_ndn = op->o_bd->be_rootndn;
289 (void)op->o_bd->be_search( &op2, &rs2 );
311 (void)op->o_bd->be_search( &op2, &rs2 );
331 Operation *op,
339 memberof_cbinfo_t *mci = op->o_callback->sc_private;
343 Operation op2 = *op;
356 op2.o_dn = op->o_bd->be_rootdn;
357 op2.o_ndn = op->o_bd->be_rootndn;
411 (void)op->o_bd->be_modify( &op2, &rs2 );
420 op->o_log_prefix, buf, 0 );
453 (void)op->o_bd->be_modify( &op2, &rs2 );
462 op->o_log_prefix, buf, 0 );
483 memberof_cleanup( Operation *op, SlapReply *rs )
485 slap_callback *sc = op->o_callback;
488 op->o_callback = sc->sc_next;
490 ber_bvarray_free_x( mci->memberof, op->o_tmpmemctx );
492 ber_bvarray_free_x( mci->member, op->o_tmpmemctx );
493 op->o_tmpfree( sc, op->o_tmpmemctx );
497 static int memberof_res_add( Operation *op, SlapReply *rs );
498 static int memberof_res_delete( Operation *op, SlapReply *rs );
499 static int memberof_res_modify( Operation *op, SlapReply *rs );
500 static int memberof_res_modrdn( Operation *op, SlapReply *rs );
503 memberof_op_add( Operation *op, SlapReply *rs )
505 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
516 LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
521 if ( op->ora_e->e_attrs == NULL ) {
526 op->o_log_prefix, op->o_req_dn.bv_val, 0 );
531 for ( ap = &op->ora_e->e_attrs; *ap; ap = &(*ap)->a_next ) {
541 save_dn = op->o_dn;
542 save_ndn = op->o_ndn;
545 && !get_relax( op )
546 && is_entry_objectclass_or_sub( op->ora_e, mo->mo_oc_group ) )
548 op->o_dn = op->o_bd->be_rootdn;
549 op->o_ndn = op->o_bd->be_rootndn;
550 op->o_bd->bd_info = (BackendInfo *)on->on_info;
552 for ( ap = &op->ora_e->e_attrs; *ap; ) {
569 rc = be_entry_get_rw( op, &a->a_nvals[ i ],
572 be_entry_release_r( op, e );
580 send_ldap_result( op, rs );
589 op->o_log_prefix, op->ora_e->e_name.bv_val,
624 op->o_dn = save_dn;
625 op->o_ndn = save_ndn;
626 op->o_bd->bd_info = (BackendInfo *)on;
636 op->o_bd->bd_info = (BackendInfo *)on->on_info;
638 rc = access_allowed( op, op->ora_e, mo->mo_ad_memberof,
644 send_ldap_result( op, rs );
651 rc = be_entry_get_rw( op, &a->a_nvals[ i ],
653 op->o_bd->bd_info = (BackendInfo *)on;
655 if ( get_relax( op ) ) {
663 send_ldap_result( op, rs );
672 op->o_log_prefix, op->ora_e->e_name.bv_val,
699 op->o_bd->bd_info = (BackendInfo *)on->on_info;
700 rc = access_allowed( op, e, mo->mo_ad_member,
701 &op->o_req_ndn, ACL_WADD, NULL );
702 be_entry_release_r( op, e );
703 op->o_bd->bd_info = (BackendInfo *)on;
708 send_ldap_result( op, rs );
721 sc = op->o_tmpalloc( sizeof(slap_callback)+sizeof(*mci), op->o_tmpmemctx );
729 sc->sc_next = op->o_callback;
730 op->o_callback = sc;
733 op->o_dn = save_dn;
734 op->o_ndn = save_ndn;
735 op->o_bd->bd_info = (BackendInfo *)on;
741 memberof_op_delete( Operation *op, SlapReply *rs )
743 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
750 LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
755 sc = op->o_tmpalloc( sizeof(slap_callback)+sizeof(*mci), op->o_tmpmemctx );
768 memberof_isGroupOrMember( op, mci );
770 sc->sc_next = op->o_callback;
771 op->o_callback = sc;
777 memberof_op_modify( Operation *op, SlapReply *rs )
779 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
789 LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
795 for ( mlp = &op->orm_modlist; *mlp; mlp = &(*mlp)->sml_next ) {
805 save_dn = op->o_dn;
806 save_ndn = op->o_ndn;
810 if ( memberof_isGroupOrMember( op, &mcis ) == LDAP_SUCCESS
815 for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
828 && !get_relax( op ) )
830 op->o_dn = op->o_bd->be_rootdn;
831 op->o_ndn = op->o_bd->be_rootndn;
832 op->o_bd->bd_info = (BackendInfo *)on->on_info;
834 assert( op->orm_modlist != NULL );
836 for ( mlp = &op->orm_modlist; *mlp; ) {
873 if ( be_entry_get_rw( op, &ml->sml_nvalues[ i ],
876 be_entry_release_r( op, e );
884 send_ldap_result( op, rs );
893 op->o_log_prefix, op->o_req_dn.bv_val,
937 op->o_bd->bd_info = (BackendInfo *)on->on_info;
938 rc = be_entry_get_rw( op, &op->o_req_ndn,
940 op->o_bd->bd_info = (BackendInfo *)on;
943 send_ldap_result( op, rs );
955 op->o_bd->bd_info = (BackendInfo *)on->on_info;
957 rc = access_allowed( op, target,
965 send_ldap_result( op, rs );
969 rc = be_entry_get_rw( op, &ml->sml_nvalues[ i ],
971 op->o_bd->bd_info = (BackendInfo *)on;
973 if ( get_relax( op ) ) {
981 send_ldap_result( op, rs );
990 op->o_log_prefix, op->o_req_ndn.bv_val,
1018 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1019 rc = access_allowed( op, e, mo->mo_ad_member,
1020 &op->o_req_ndn,
1022 be_entry_release_r( op, e );
1023 op->o_bd->bd_info = (BackendInfo *)on;
1028 send_ldap_result( op, rs );
1045 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1047 rc = access_allowed( op, target,
1051 op->o_bd->bd_info = (BackendInfo *)on;
1055 send_ldap_result( op, rs );
1070 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1072 rc = access_allowed( op, target,
1080 send_ldap_result( op, rs );
1088 rc = be_entry_get_rw( op, &ml->sml_nvalues[ i ],
1090 op->o_bd->bd_info = (BackendInfo *)on;
1096 send_ldap_result( op, rs );
1105 op->o_log_prefix, op->o_req_ndn.bv_val,
1133 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1134 rc = access_allowed( op, e, mo->mo_ad_member,
1135 &op->o_req_ndn,
1137 be_entry_release_r( op, e );
1138 op->o_bd->bd_info = (BackendInfo *)on;
1143 send_ldap_result( op, rs );
1161 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1162 be_entry_release_r( op, target );
1163 op->o_bd->bd_info = (BackendInfo *)on;
1166 sc = op->o_tmpalloc( sizeof(slap_callback)+sizeof(*mci), op->o_tmpmemctx );
1177 op->o_dn = op->o_bd->be_rootdn;
1178 op->o_ndn = op->o_bd->be_rootndn;
1179 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1180 rc = backend_attribute( op, NULL, &op->o_req_ndn,
1182 op->o_bd->bd_info = (BackendInfo *)on;
1185 sc->sc_next = op->o_callback;
1186 op->o_callback = sc;
1191 op->o_dn = save_dn;
1192 op->o_ndn = save_ndn;
1193 op->o_bd->bd_info = (BackendInfo *)on;
1199 memberof_op_modrdn( Operation *op, SlapReply *rs )
1201 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
1206 LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
1211 sc = op->o_tmpalloc( sizeof(slap_callback)+sizeof(*mci), op->o_tmpmemctx );
1220 sc->sc_next = op->o_callback;
1221 op->o_callback = sc;
1230 memberof_res_add( Operation *op, SlapReply *rs )
1232 memberof_cbinfo_t *mci = op->o_callback->sc_private;
1245 ma = attr_find( op->ora_e->e_attrs, mo->mo_ad_memberof );
1249 op->o_relax = SLAP_CONTROL_CRITICAL;
1254 if ( dn_match( &ma->a_nvals[i], &op->o_req_ndn ))
1259 memberof_value_modify( op,
1261 NULL, NULL, &op->o_req_dn, &op->o_req_ndn );
1266 if ( is_entry_objectclass_or_sub( op->ora_e, mo->mo_oc_group ) ) {
1269 for ( a = attrs_find( op->ora_e->e_attrs, mo->mo_ad_member );
1275 if ( dn_match( &a->a_nvals[i], &op->o_req_ndn ))
1278 memberof_value_modify( op,
1282 &op->o_req_dn,
1283 &op->o_req_ndn );
1295 memberof_res_delete( Operation *op, SlapReply *rs )
1297 memberof_cbinfo_t *mci = op->o_callback->sc_private;
1311 memberof_value_modify( op,
1313 &op->o_req_dn, &op->o_req_ndn,
1322 memberof_value_modify( op,
1324 &op->o_req_dn, &op->o_req_ndn,
1338 memberof_res_modify( Operation *op, SlapReply *rs )
1340 memberof_cbinfo_t *mci = op->o_callback->sc_private;
1353 for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
1368 memberof_value_modify( op,
1370 &op->o_req_dn, &op->o_req_ndn,
1379 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1380 rc = backend_attribute( op, NULL, &op->o_req_ndn,
1382 op->o_bd->bd_info = (BackendInfo *)on;
1385 memberof_value_modify( op,
1387 &op->o_req_dn, &op->o_req_ndn,
1390 ber_bvarray_free_x( vals, op->o_tmpmemctx );
1402 memberof_value_modify( op,
1405 &op->o_req_dn, &op->o_req_ndn );
1416 for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
1426 memberof_value_modify( op,
1428 &op->o_req_dn, &op->o_req_ndn,
1441 memberof_value_modify( op,
1443 &op->o_req_dn, &op->o_req_ndn,
1457 memberof_value_modify( op,
1460 &op->o_req_dn, &op->o_req_ndn );
1478 memberof_res_modrdn( Operation *op, SlapReply *rs )
1480 memberof_cbinfo_t *mci = op->o_callback->sc_private;
1499 if ( op->orr_nnewSup ) {
1500 newPNDN = *op->orr_nnewSup;
1503 dnParent( &op->o_req_ndn, &newPNDN );
1506 build_new_dn( &newNDN, &newPNDN, &op->orr_nnewrdn, op->o_tmpmemctx );
1508 save_dn = op->o_req_dn;
1509 save_ndn = op->o_req_ndn;
1511 op->o_req_dn = newNDN;
1512 op->o_req_ndn = newNDN;
1513 rc = memberof_isGroupOrMember( op, mci );
1514 op->o_req_dn = save_dn;
1515 op->o_req_ndn = save_ndn;
1521 if ( op->orr_newSup ) {
1522 newPDN = *op->orr_newSup;
1525 dnParent( &op->o_req_dn, &newPDN );
1528 build_new_dn( &newDN, &newPDN, &op->orr_newrdn, op->o_tmpmemctx );
1531 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1532 rc = backend_attribute( op, NULL, &newNDN,
1534 op->o_bd->bd_info = (BackendInfo *)on;
1538 memberof_value_modify( op,
1540 &op->o_req_dn, &op->o_req_ndn,
1543 ber_bvarray_free_x( vals, op->o_tmpmemctx );
1548 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1549 rc = backend_attribute( op, NULL, &newNDN,
1551 op->o_bd->bd_info = (BackendInfo *)on;
1555 memberof_value_modify( op,
1557 &op->o_req_dn, &op->o_req_ndn,
1560 ber_bvarray_free_x( vals, op->o_tmpmemctx );
1566 op->o_tmpfree( newDN.bv_val, op->o_tmpmemctx );
1568 op->o_tmpfree( newNDN.bv_val, op->o_tmpmemctx );
1769 if ( c->op == SLAP_CONFIG_EMIT ) {
1846 } else if ( c->op == LDAP_MOD_DELETE ) {