• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/OpenLDAP-491.1/OpenLDAP/servers/slapd/

Lines Matching refs:op

38     Operation	*op,
41 BerElement *ber = op->o_ber;
50 op->o_log_prefix, 0, 0 );
55 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
56 if ( op->o_conn->c_sasl_bind_in_progress ) {
57 be = op->o_conn->c_authz_backend;
59 if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
63 op->o_log_prefix, 0, 0, 0, 0 );
65 connection2anonymous( op->o_conn );
66 if ( op->o_conn->c_sasl_bind_in_progress ) {
67 op->o_conn->c_authz_backend = be;
69 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
70 if ( !BER_BVISNULL( &op->o_dn ) ) {
74 op->o_dn.bv_val[0] = '\0';
75 op->o_dn.bv_len = 0;
77 if ( !BER_BVISNULL( &op->o_ndn ) ) {
78 op->o_ndn.bv_val[0] = '\0';
79 op->o_ndn.bv_len = 0;
106 op->o_log_prefix, 0, 0 );
107 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
112 op->o_protocol = version;
113 op->orb_method = method;
115 if( op->orb_method != LDAP_AUTH_SASL ) {
116 tag = ber_scanf( ber, /*{*/ "m}", &op->orb_cred );
126 tag = ber_scanf( ber, "m", &op->orb_cred );
129 BER_BVZERO( &op->orb_cred );
140 op->o_log_prefix, 0, 0 );
141 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
146 if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
148 op->o_log_prefix, 0, 0 );
154 * resulting DNs in the op or conn structures.
156 rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
157 op->o_tmpmemctx );
160 op->o_log_prefix, dn.bv_val, 0 );
161 send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
166 op->o_log_prefix, op->o_req_dn.bv_val,
167 (unsigned long) op->orb_method, 0, 0 );
169 if( op->orb_method == LDAP_AUTH_SASL ) {
171 op->o_req_dn.bv_val, mech.bv_val, NULL );
176 (unsigned long) version, op->o_req_dn.bv_val,
177 (unsigned long) op->orb_method );
182 op->o_log_prefix, (unsigned long) version, 0 );
183 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
190 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
198 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
199 op->o_conn->c_protocol = version;
200 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
202 op->orb_mech = mech;
204 op->o_bd = frontendDB;
205 rs->sr_err = frontendDB->be_bind( op, rs );
209 if ( op->orb_method != LDAP_AUTH_SASL ) {
210 ber_dupbv( &op->o_conn->c_authmech, &mech );
212 op->o_conn->c_authtype = op->orb_method;
215 if( !BER_BVISNULL( &op->o_req_dn ) ) {
216 slap_sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
217 BER_BVZERO( &op->o_req_dn );
219 if( !BER_BVISNULL( &op->o_req_ndn ) ) {
220 slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
221 BER_BVZERO( &op->o_req_ndn );
228 fe_op_bind( Operation *op, SlapReply *rs )
230 BackendDB *bd = op->o_bd;
233 if( get_manageDSAit( op ) == SLAP_CONTROL_CRITICAL ) {
234 send_ldap_error( op, rs,
240 if ( op->orb_method == LDAP_AUTH_SASL ) {
241 if ( op->o_protocol < LDAP_VERSION3 ) {
243 (unsigned long)op->o_protocol, 0, 0 );
244 send_ldap_discon( op, rs,
250 if( BER_BVISNULL( &op->orb_mech ) || BER_BVISEMPTY( &op->orb_mech ) ) {
254 send_ldap_error( op, rs, LDAP_AUTH_METHOD_NOT_SUPPORTED,
260 if( backend_check_restrictions( op, rs, &op->orb_mech ) != LDAP_SUCCESS ) {
261 send_ldap_result( op, rs );
265 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
266 if ( op->o_conn->c_sasl_bind_in_progress ) {
267 if( !bvmatch( &op->o_conn->c_sasl_bind_mech, &op->orb_mech ) ) {
269 slap_sasl_reset(op->o_conn);
272 ber_dupbv(&op->o_conn->c_sasl_bind_mech, &op->orb_mech);
276 op->o_conn->c_sasl_bindop = op;
278 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
280 rs->sr_err = slap_sasl_bind( op, rs );
286 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
288 if ( !BER_BVISNULL( &op->o_conn->c_sasl_bind_mech ) ) {
289 free( op->o_conn->c_sasl_bind_mech.bv_val );
290 BER_BVZERO( &op->o_conn->c_sasl_bind_mech );
292 op->o_conn->c_sasl_bind_in_progress = 0;
294 slap_sasl_reset( op->o_conn );
295 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
298 if ( op->orb_method == LDAP_AUTH_SIMPLE ) {
299 BER_BVSTR( &op->orb_mech, "SIMPLE" );
301 if ( BER_BVISEMPTY( &op->orb_cred ) || BER_BVISEMPTY( &op->o_req_ndn ) ) {
304 if( !BER_BVISEMPTY( &op->orb_cred ) &&
310 } else if ( !BER_BVISEMPTY( &op->o_req_ndn ) &&
324 backend_check_restrictions( op, rs, &op->orb_mech );
331 send_ldap_result( op, rs );
333 op->o_protocol, 0, 0 );
341 send_ldap_result( op, rs );
344 op->o_protocol, op->o_req_ndn.bv_val, 0 );
352 send_ldap_result( op, rs );
355 op->o_protocol, op->orb_method, 0 );
365 if ( (op->o_bd = select_backend( &op->o_req_ndn, 0 )) == NULL ) {
369 op->o_bd = bd;
370 send_ldap_result( op, rs );
375 if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
376 send_ldap_result( op, rs );
380 if( op->o_bd->be_bind ) {
381 op->o_conn->c_authz_cookie = NULL;
383 rs->sr_err = (op->o_bd->be_bind)( op, rs );
386 (void)fe_op_bind_success( op, rs );
388 } else if ( !BER_BVISNULL( &op->orb_edn ) ) {
389 free( op->orb_edn.bv_val );
390 BER_BVZERO( &op->orb_edn );
394 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
399 op->o_bd = bd;
404 fe_op_bind_success( Operation *op, SlapReply *rs )
406 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
408 if( op->o_conn->c_authz_backend == NULL ) {
409 op->o_conn->c_authz_backend = op->o_bd;
413 if( !BER_BVISEMPTY( &op->orb_edn ) ) {
414 op->o_conn->c_dn = op->orb_edn;
416 ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
419 ber_dupbv( &op->o_conn->c_ndn, &op->o_req_ndn );
421 /* op->o_conn->c_sb may be 0 for internal operations */
422 if( !BER_BVISEMPTY( &op->o_conn->c_dn ) && op->o_conn->c_sb != 0 ) {
424 ber_sockbuf_ctrl( op->o_conn->c_sb,
431 op->o_log_prefix,
432 op->o_conn->c_dn.bv_val, op->orb_mech.bv_val, 0, 0 );
436 op->o_protocol, op->o_req_dn.bv_val, op->o_conn->c_dn.bv_val );
438 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
441 send_ldap_result( op, rs );