Lines Matching refs:op
37 do_add( Operation *op, SlapReply *rs )
39 BerElement *ber = op->o_ber;
54 op->o_log_prefix, 0, 0 );
71 op->o_log_prefix, 0, 0 );
72 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
77 op->o_log_prefix, dn.bv_val, 0 );
92 op->o_log_prefix, 0, 0 );
93 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
100 op->o_log_prefix, tmp.sml_type.bv_val, 0 );
101 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
121 op->o_log_prefix, 0, 0 );
122 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
127 if ( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
129 op->o_log_prefix, 0, 0 );
133 rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
134 op->o_tmpmemctx );
138 op->o_log_prefix, dn.bv_val, 0 );
139 send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
143 op->ora_e = entry_alloc();
144 ber_dupbv( &op->ora_e->e_name, &op->o_req_dn );
145 ber_dupbv( &op->ora_e->e_nname, &op->o_req_ndn );
148 op->o_log_prefix, op->o_req_dn.bv_val, 0, 0, 0 );
151 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
156 if ( dn_match( &op->ora_e->e_nname, &slap_empty_bv ) ) {
158 send_ldap_error( op, rs, LDAP_ALREADY_EXISTS,
162 } else if ( dn_match( &op->ora_e->e_nname, &frontendDB->be_schemandn ) ) {
163 send_ldap_error( op, rs, LDAP_ALREADY_EXISTS,
168 rs->sr_err = slap_mods_check( op, modlist, &rs->sr_text,
172 send_ldap_result( op, rs );
177 op->ora_modlist = modlist;
180 rs->sr_err = slap_mods2entry( op->ora_modlist, &op->ora_e,
183 send_ldap_result( op, rs );
191 LDAP_SLIST_INSERT_HEAD(&op->o_extra, &oex.oe, oe_next);
193 op->o_bd = frontendDB;
194 rc = frontendDB->be_add( op, rs );
195 LDAP_SLIST_REMOVE(&op->o_extra, &oex.oe, OpExtra, oe_next);
204 if ( op->ora_e != NULL && oex.oe_db != NULL ) {
205 BackendDB *bd = op->o_bd;
207 op->o_bd = oex.oe_db;
209 be_entry_release_w( op, op->ora_e );
211 op->ora_e = NULL;
212 op->o_bd = bd;
222 if ( op->ora_e != NULL ) {
223 entry_free( op->ora_e );
225 op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
226 op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
232 fe_op_add( Operation *op, SlapReply *rs )
234 Modifications **modtail = &op->ora_modlist;
236 BackendDB *op_be, *bd = op->o_bd;
245 op->o_bd = select_backend( &op->ora_e->e_nname, 1 );
246 if ( op->o_bd == NULL ) {
247 op->o_bd = bd;
249 NULL, &op->ora_e->e_name, LDAP_SCOPE_DEFAULT );
253 send_ldap_result( op, rs );
259 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
266 op_be = op->o_bd;
267 if ( SLAP_GLUE_INSTANCE( op->o_bd )) {
268 op->o_bd = select_backend( &op->ora_e->e_nname, 0 );
272 if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
273 send_ldap_result( op, rs );
278 if( backend_check_referrals( op, rs ) != LDAP_SUCCESS ) {
282 rs->sr_err = slap_mods_obsolete_check( op, op->ora_modlist,
286 send_ldap_result( op, rs );
296 if ( op->o_bd->be_add ) {
298 int repl_user = be_isupdate( op );
299 if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user ) {
300 int update = !BER_BVISEMPTY( &op->o_bd->be_update_ndn );
302 op->o_bd = op_be;
305 rs->sr_err = slap_mods_no_user_mod_check( op, op->ora_modlist,
309 send_ldap_result( op, rs );
316 for ( modtail = &op->ora_modlist;
326 rs->sr_err = slap_mods_no_repl_user_mod_check( op,
327 op->ora_modlist, &rs->sr_text, textbuf, textlen );
329 send_ldap_result( op, rs );
334 rc = op->o_bd->be_add( op, rs );
341 LDAP_SLIST_FOREACH(oex, &op->o_extra, oe_next) {
343 ((OpExtraDB *)oex)->oe_db = op->o_bd;
352 defref = op->o_bd->be_update_refs
353 ? op->o_bd->be_update_refs : default_referral;
357 NULL, &op->ora_e->e_name, LDAP_SCOPE_DEFAULT );
361 send_ldap_result( op, rs );
367 send_ldap_error( op, rs,
374 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
379 op->o_bd = bd;
583 Operation *op,
595 if ( SLAP_LASTMOD( op->o_bd ) ) {
600 a = attr_find( op->ora_e->e_attrs, slap_schema.si_ad_entryCSN );
605 if ( BER_BVISEMPTY( &op->o_csn )) {
609 slap_get_csn( op, &csn, manage_ctxcsn );
612 slap_queue_csn( op, &csn );
615 csn = op->o_csn;
631 if ( BER_BVISEMPTY( &op->o_dn ) ) {
635 name = op->o_dn;
636 nname = op->o_ndn;
639 a = attr_find( op->ora_e->e_attrs,
647 attr_merge_normalize_one( op->ora_e,
648 slap_schema.si_ad_entryUUID, &tmp, op->o_tmpmemctx );
651 a = attr_find( op->ora_e->e_attrs,
654 attr_merge_one( op->ora_e,
658 a = attr_find( op->ora_e->e_attrs,
661 attr_merge_one( op->ora_e,
666 attr_merge_one( op->ora_e,
670 a = attr_find( op->ora_e->e_attrs,
673 attr_merge_one( op->ora_e,
677 a = attr_find( op->ora_e->e_attrs,
680 attr_merge_one( op->ora_e,