Lines Matching refs:op

44     Operation	*op,
47 BerElement *ber = op->o_ber;
56 op->o_log_prefix );
61 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
62 if ( op->o_conn->c_sasl_bind_in_progress ) {
63 be = op->o_conn->c_authz_backend;
65 if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
69 op->o_log_prefix, op->o_conn->c_ssf );
71 connection2anonymous( op->o_conn );
72 if ( op->o_conn->c_sasl_bind_in_progress ) {
73 op->o_conn->c_authz_backend = be;
75 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
76 if ( !BER_BVISNULL( &op->o_dn ) ) {
80 op->o_dn.bv_val[0] = '\0';
81 op->o_dn.bv_len = 0;
83 if ( !BER_BVISNULL( &op->o_ndn ) ) {
84 op->o_ndn.bv_val[0] = '\0';
85 op->o_ndn.bv_len = 0;
112 op->o_log_prefix );
113 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
118 op->o_protocol = version;
119 op->orb_method = method;
121 if( op->orb_method != LDAP_AUTH_SASL ) {
122 tag = ber_scanf( ber, /*{*/ "m}", &op->orb_cred );
132 tag = ber_scanf( ber, "m", &op->orb_cred );
135 BER_BVZERO( &op->orb_cred );
146 op->o_log_prefix );
147 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
152 if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
154 op->o_log_prefix );
160 * resulting DNs in the op or conn structures.
162 rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
163 op->o_tmpmemctx );
166 op->o_log_prefix, dn.bv_val );
167 send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
172 op->o_log_prefix, op->o_req_dn.bv_val,
173 (unsigned long) op->orb_method );
175 if( op->orb_method == LDAP_AUTH_SASL ) {
177 op->o_req_dn.bv_val, mech.bv_val );
182 (unsigned long) version, op->o_req_dn.bv_val,
183 (unsigned long) op->orb_method );
188 op->o_log_prefix, (unsigned long) version );
189 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
196 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
204 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
205 op->o_conn->c_protocol = version;
206 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
208 op->orb_mech = mech;
210 op->o_bd = frontendDB;
211 rs->sr_err = frontendDB->be_bind( op, rs );
215 if ( op->orb_method != LDAP_AUTH_SASL ) {
216 ber_dupbv( &op->o_conn->c_authmech, &mech );
218 op->o_conn->c_authtype = op->orb_method;
221 if( !BER_BVISNULL( &op->o_req_dn ) ) {
222 slap_sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
223 BER_BVZERO( &op->o_req_dn );
225 if( !BER_BVISNULL( &op->o_req_ndn ) ) {
226 slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
227 BER_BVZERO( &op->o_req_ndn );
234 fe_op_bind( Operation *op, SlapReply *rs )
236 BackendDB *bd = op->o_bd;
239 if( get_manageDSAit( op ) == SLAP_CONTROL_CRITICAL ) {
240 send_ldap_error( op, rs,
246 if ( op->orb_method == LDAP_AUTH_SASL ) {
247 if ( op->o_protocol < LDAP_VERSION3 ) {
249 (unsigned long)op->o_protocol );
250 send_ldap_discon( op, rs,
256 if( BER_BVISNULL( &op->orb_mech ) || BER_BVISEMPTY( &op->orb_mech ) ) {
259 send_ldap_error( op, rs, LDAP_AUTH_METHOD_NOT_SUPPORTED,
265 if( backend_check_restrictions( op, rs, &op->orb_mech ) != LDAP_SUCCESS ) {
266 send_ldap_result( op, rs );
270 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
271 if ( op->o_conn->c_sasl_bind_in_progress ) {
272 if( !bvmatch( &op->o_conn->c_sasl_bind_mech, &op->orb_mech ) ) {
274 slap_sasl_reset(op->o_conn);
277 ber_dupbv(&op->o_conn->c_sasl_bind_mech, &op->orb_mech);
281 op->o_conn->c_sasl_bindop = op;
283 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
285 rs->sr_err = slap_sasl_bind( op, rs );
291 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
293 if ( !BER_BVISNULL( &op->o_conn->c_sasl_bind_mech ) ) {
294 free( op->o_conn->c_sasl_bind_mech.bv_val );
295 BER_BVZERO( &op->o_conn->c_sasl_bind_mech );
297 op->o_conn->c_sasl_bind_in_progress = 0;
299 slap_sasl_reset( op->o_conn );
300 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
303 if ( op->orb_method == LDAP_AUTH_SIMPLE ) {
304 BER_BVSTR( &op->orb_mech, "SIMPLE" );
306 if ( BER_BVISEMPTY( &op->orb_cred ) || BER_BVISEMPTY( &op->o_req_ndn ) ) {
309 if( !BER_BVISEMPTY( &op->orb_cred ) &&
315 } else if ( !BER_BVISEMPTY( &op->o_req_ndn ) &&
329 backend_check_restrictions( op, rs, &op->orb_mech );
336 send_ldap_result( op, rs );
338 op->o_protocol );
346 send_ldap_result( op, rs );
349 op->o_protocol, op->o_req_ndn.bv_val );
357 send_ldap_result( op, rs );
360 op->o_protocol, op->orb_method );
370 if ( (op->o_bd = select_backend( &op->o_req_ndn, 0 )) == NULL ) {
374 op->o_bd = bd;
375 send_ldap_result( op, rs );
380 if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
381 send_ldap_result( op, rs );
385 if( op->o_bd->be_bind ) {
386 op->o_conn->c_authz_cookie = NULL;
388 rs->sr_err = (op->o_bd->be_bind)( op, rs );
391 (void)fe_op_bind_success( op, rs );
393 } else if ( !BER_BVISNULL( &op->orb_edn ) ) {
394 free( op->orb_edn.bv_val );
395 BER_BVZERO( &op->orb_edn );
399 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
404 op->o_bd = bd;
409 fe_op_lastbind( Operation *op )
411 Operation op2 = *op;
423 rc = be_entry_get_rw( op, &op->o_conn->c_ndn, NULL, NULL, 0, &e );
439 a->a_nvals[0].bv_val, bindtime == (time_t)-1 ? -1 : op->o_time - bindtime );
445 if ( bindtime != (time_t)-1 && op->o_time <= bindtime ) {
446 be_entry_release_r( op, e );
454 slap_timestamp( &op->o_time, &timestamp );
468 be_entry_release_r( op, e );
471 op2.o_req_dn = op->o_conn->c_dn;
472 op2.o_req_ndn = op->o_conn->c_ndn;
476 op2.o_dn = op->o_bd->be_rootdn;
477 op2.o_ndn = op->o_bd->be_rootndn;
491 if ( SLAP_SHADOW( op->o_bd ) ) {
502 if ( SLAP_SINGLE_SHADOW( op->o_bd )) {
508 rc = op->o_bd->be_modify( &op2, &r2 );
516 fe_op_bind_success( Operation *op, SlapReply *rs )
518 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
520 if( op->o_conn->c_authz_backend == NULL ) {
521 op->o_conn->c_authz_backend = op->o_bd;
525 if( !BER_BVISEMPTY( &op->orb_edn ) ) {
526 op->o_conn->c_dn = op->orb_edn;
528 ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
531 ber_dupbv( &op->o_conn->c_ndn, &op->o_req_ndn );
533 /* op->o_conn->c_sb may be 0 for internal operations */
534 if( !BER_BVISEMPTY( &op->o_conn->c_dn ) && op->o_conn->c_sb != 0 ) {
536 ber_sockbuf_ctrl( op->o_conn->c_sb,
543 op->o_log_prefix,
544 op->o_conn->c_dn.bv_val, op->orb_mech.bv_val, op->o_conn->c_ssf );
548 op->o_protocol, op->o_req_dn.bv_val, op->o_conn->c_dn.bv_val );
550 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
552 if ( SLAP_LASTBIND( op->o_bd ) ) {
553 fe_op_lastbind( op );
557 send_ldap_result( op, rs );