Lines Matching refs:op
152 ldap_back_getconn( Operation *op, SlapReply *rs, ldap_back_send_t sendok,
156 ldap_back_is_proxy_authz( Operation *op, SlapReply *rs, ldap_back_send_t sendok,
160 ldap_back_proxy_authz_bind( ldapconn_t *lc, Operation *op, SlapReply *rs,
164 ldap_back_prepare_conn( ldapconn_t *lc, Operation *op, SlapReply *rs,
205 ldap_back_bind( Operation *op, SlapReply *rs )
207 ldapinfo_t *li = (ldapinfo_t *) op->o_bd->be_private;
219 switch ( be_rootdn_bind( op, rs ) ) {
227 lc = ldap_back_getconn( op, rs, LDAP_BACK_BIND_SERR, NULL, NULL );
246 save_o_dn = op->o_dn;
247 save_o_do_not_cache = op->o_do_not_cache;
248 op->o_dn = op->o_req_dn;
249 op->o_do_not_cache = 1;
251 ctrls = op->o_ctrls;
252 rc = ldap_back_controls_add( op, rs, lc, &ctrls );
253 op->o_dn = save_o_dn;
254 op->o_do_not_cache = save_o_do_not_cache;
256 send_ldap_result( op, rs );
263 rs->sr_err = ldap_sasl_bind( lc->lc_ld, op->o_req_dn.bv_val,
265 &op->orb_cred, ctrls, NULL, &msgid );
268 rc = ldap_back_op_result( lc, op, rs, msgid,
273 if ( ldap_back_retry( &lc, op, rs, LDAP_BACK_BIND_SERR ) ) {
278 ldap_back_controls_free( op, rs, &ctrls );
281 op->o_conn->c_authz_cookie = op->o_bd->be_private;
298 ber_dupbv( &lc->lc_bound_ndn, &op->o_req_ndn );
306 ber_bvreplace( &lc->lc_cred, &op->orb_cred );
316 || ( !dn_match( &op->o_req_ndn, &lc->lc_local_ndn )
364 ber_bvreplace( &lc->lc_local_ndn, &op->o_req_ndn );
365 if ( be_isroot_dn( op->o_bd, &op->o_req_ndn ) ) {
366 LDAP_BACK_PCONN_ROOTDN_SET( lc, op );
665 ldap_back_prepare_conn( ldapconn_t *lc, Operation *op, SlapReply *rs, ldap_back_send_t sendok )
667 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
671 int is_tls = op->o_conn->c_is_tls;
694 } else if ( op->o_protocol != 0 ) {
695 version = op->o_protocol;
698 /* assume it's an internal op; set to LDAPv3 */
747 rs->sr_err = ldap_back_start_tls( ld, op->o_protocol, &is_tls,
758 lctime = op->o_time;
782 send_ldap_result( op, rs );
787 lc->lc_create_time = op->o_time;
796 Operation *op,
802 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
825 op->o_log_prefix, ri->ri_idx, ri->ri_count );
834 if ( op->o_conn && ( sendok & LDAP_BACK_SENDERR ) ) {
836 send_ldap_result( op, rs );
843 if ( op->o_do_not_cache || be_isroot( op ) ) {
845 lc_curr.lc_local_ndn = op->o_bd->be_rootndn;
846 LDAP_BACK_PCONN_ROOTDN_SET( &lc_curr, op );
862 if ( op->o_tag == LDAP_REQ_BIND ) {
863 save_o_dn = op->o_dn;
864 save_o_ndn = op->o_ndn;
865 op->o_dn = op->o_req_dn;
866 op->o_ndn = op->o_req_ndn;
868 isproxyauthz = ldap_back_is_proxy_authz( op, rs, sendok, binddn, bindcred );
869 if ( op->o_tag == LDAP_REQ_BIND ) {
870 op->o_dn = save_o_dn;
871 op->o_ndn = save_o_ndn;
877 lc_curr.lc_local_ndn = op->o_ndn;
881 if ( op->o_tag == LDAP_REQ_BIND && !isproxyauthz ) {
882 lc_curr.lc_conn = op->o_conn;
887 LDAP_BACK_PCONN_ROOTDN_SET( &lc_curr, op );
892 LDAP_BACK_PCONN_BIND_SET( &lc_curr, op );
896 } else if ( SLAP_IS_AUTHZ_BACKEND( op ) ) {
897 lc_curr.lc_conn = op->o_conn;
900 LDAP_BACK_PCONN_ANON_SET( &lc_curr, op );
957 if ( op->o_tag == LDAP_REQ_BIND ) {
974 if ( ldap_back_prepare_conn( lc, op, rs, sendok ) != LDAP_SUCCESS ) {
1020 if ( !BER_BVISEMPTY( &op->o_ndn )
1021 && SLAP_IS_AUTHZ_BACKEND( op ) )
1023 ber_dupbv( &lc->lc_bound_ndn, &op->o_ndn );
1104 op->o_log_prefix, buf, 0 );
1131 if ( op->o_conn && ( sendok & LDAP_BACK_SENDERR ) ) {
1132 send_ldap_result( op, rs );
1141 if ( ( li->li_idle_timeout != 0 && op->o_time > lc->lc_time + li->li_idle_timeout )
1142 || ( li->li_conn_ttl != 0 && op->o_time > lc->lc_create_time + li->li_conn_ttl ) )
1209 Operation *op,
1212 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
1229 op->o_log_prefix, 0, 0 );
1238 op->o_log_prefix, ri->ri_idx, ri->ri_count );
1263 op->o_log_prefix, li->li_isquarantined, rs->sr_err );
1280 Operation *op,
1284 ber_tag_t *tptr = op->o_callback->sc_private;
1285 op->o_tag = *tptr;
1286 rs->sr_tag = slap_req2res( op->o_tag );
1299 Operation *op,
1305 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
1315 ber_tag_t o_tag = op->o_tag;
1325 lc = ldap_back_getconn( op, rs, sendok, &binddn, &bindcred );
1393 op->o_tag = LDAP_REQ_BIND;
1394 cb.sc_next = op->o_callback;
1397 op->o_callback = &cb;
1402 rc = ldap_back_is_proxy_authz( op, rs,
1406 rc = ldap_back_proxy_authz_bind( lc, op, rs, sendok, &binddn, &bindcred );
1443 send_ldap_result( op, rs );
1473 send_ldap_result( op, rs );
1479 ldap_back_quarantine( op, rs );
1492 op->o_log_prefix, lc->lc_bound_ndn.bv_val, 0 );
1515 rs->sr_err = ldap_back_prepare_conn( lc, op, rs, sendok );
1541 ldap_back_quarantine( op, rs );
1547 if ( op->o_callback == &cb )
1548 op->o_callback = cb.sc_next;
1549 op->o_tag = o_tag;
1551 send_ldap_result( op, rs );
1558 rc = ldap_back_op_result( lc, op, rs, msgid,
1561 op->o_conn->c_authz_cookie = op->o_bd->be_private;
1576 if ( op->o_callback == &cb )
1577 op->o_callback = cb.sc_next;
1578 op->o_tag = o_tag;
1589 ldap_back_dobind( ldapconn_t **lcp, Operation *op, SlapReply *rs, ldap_back_send_t sendok )
1591 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
1593 return ldap_back_dobind_int( lcp, op, rs,
1677 Operation *op,
1682 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
1706 Operation *op,
1712 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
1732 int timeout_err = op->o_protocol >= LDAP_VERSION3 ?
1739 slap_op_t opidx = slap_req2op( op->o_tag );
1742 if ( op->ors_tlimit <= 0 ) {
1746 timeout = op->ors_tlimit;
1767 stoptime = op->o_time + timeout;
1799 (void)ldap_back_cancel( lc, op, rs, msgid, sendok );
1824 lc->lc_time = op->o_time;
1846 op->o_log_prefix,
1854 rs->sr_ref = op->o_tmpalloc( sizeof( struct berval ) * ( i + 1 ),
1855 op->o_tmpmemctx );
1867 op->o_log_prefix,
1885 /* internal ops ( op->o_conn == NULL )
1887 if ( op->o_conn && !op->o_do_not_cache && match ) {
1898 ldap_back_quarantine( op, rs );
1900 if ( op->o_conn && ( sendok & LDAP_BACK_SENDERR ) ) {
1902 send_ldap_result( op, rs );
1906 } else if ( op->o_conn &&
1910 send_ldap_result( op, rs );
1920 op->o_tmpfree( rs->sr_ref, op->o_tmpmemctx );
1938 if ( op->o_tag == LDAP_REQ_BIND && rs->sr_err == LDAP_SUCCESS ) {
1943 rs->sr_ctrls = op->o_tmpalloc( sizeof( LDAPControl * )*( i + 1 ),
1944 op->o_tmpmemctx );
1952 rs->sr_ctrls[ i ] = op->o_tmpalloc( size, op->o_tmpmemctx );
1979 ldap_back_retry( ldapconn_t **lcp, Operation *op, SlapReply *rs, ldap_back_send_t sendok )
1981 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
1995 op->o_log_prefix, li->li_uri,
2005 rc = ldap_back_prepare_conn( *lcp, op, rs, sendok );
2020 rc = ldap_back_dobind_int( lcp, op, rs, sendok, 0, 0 );
2042 send_ldap_result( op, rs );
2052 ldap_back_is_proxy_authz( Operation *op, SlapReply *rs, ldap_back_send_t sendok,
2055 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
2059 if ( op->o_conn == NULL || op->o_do_not_cache ) {
2069 if ( op->o_protocol == 0 || op->o_protocol == LDAP_VERSION3 ) {
2077 send_ldap_result( op, rs );
2087 if ( !BER_BVISNULL( &op->o_conn->c_ndn ) ) {
2088 ndn = op->o_conn->c_ndn;
2091 ndn = op->o_ndn;
2115 send_ldap_result( op, rs );
2128 } else if ( !be_isroot( op ) ) {
2138 rs->sr_err = slap_sasl_matches( op, li->li_idassert_passthru,
2155 rs->sr_err = slap_sasl_matches( op, li->li_idassert_authz,
2160 send_ldap_result( op, rs );
2189 Operation *op,
2195 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
2200 if ( !BER_BVISNULL( &op->o_conn->c_ndn ) ) {
2201 ndn = op->o_conn->c_ndn;
2204 ndn = op->o_ndn;
2223 if ( ( !op->o_do_not_cache || !op->o_is_auth_check ) &&
2243 authzID.bv_val = slap_sl_malloc( authzID.bv_len + 1, op->o_tmpmemctx );
2263 send_ldap_result( op, rs );
2280 send_ldap_result( op, rs );
2332 op->o_log_prefix, ctrl->ldctl_value.bv_val, 0 );
2351 op->o_log_prefix, val->bv_val, 0 );
2373 op->o_conn->c_authz_cookie = op->o_bd->be_private;
2389 send_ldap_result( op, rs );
2403 slap_sl_free( authzID.bv_val, op->o_tmpmemctx );
2421 rc = ldap_back_op_result( lc, op, rs, msgid,
2430 send_ldap_result( op, rs );
2440 op->o_conn->c_authz_cookie = op->o_bd->be_private;
2470 * operations, if ( *pctrls != op->o_ctrls ), should
2493 Operation *op,
2517 if ( !op->o_conn || op->o_do_not_cache || ( isroot = be_isroot( op ) ) ) {
2521 if ( op->o_tag == LDAP_REQ_BIND ) {
2522 ndn = op->o_req_ndn;
2524 } else if ( !BER_BVISNULL( &op->o_conn->c_ndn ) ) {
2525 ndn = op->o_conn->c_ndn;
2528 ndn = op->o_ndn;
2532 if ( op->o_proxy_authz ) {
2578 rc = slap_sasl_matches( op, si->si_authz,
2590 if ( op->o_proxy_authz ) {
2612 if ( op->o_is_auth_check ) {
2663 ber_dupbv_x( &ctrl->ldctl_value, &assertedID, op->o_tmpmemctx );
2670 ctrl->ldctl_value.bv_val = op->o_tmpalloc( ctrl->ldctl_value.bv_len + 1,
2671 op->o_tmpmemctx );
2690 ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
2706 op->o_tmpfree( authzID.bv_val, op->o_tmpmemctx );
2730 ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
2749 op->o_tmpfree( authzID.bv_val, op->o_tmpmemctx );
2768 * status of op->o_ctrls.
2772 Operation *op,
2777 ldapinfo_t *li = (ldapinfo_t *)op->o_bd->be_private;
2794 if ( op->o_protocol == 0 || op->o_protocol == LDAP_VERSION3 ) {
2806 switch ( ldap_back_proxy_authz_ctrl( op, rs, &lc->lc_bound_ndn,
2829 switch ( slap_ctrl_session_tracking_request_add( op, rs, &c[ j1 + j2 ] ) ) {
2854 if ( op->o_ctrls ) {
2855 for ( n = 0; op->o_ctrls[ n ]; n++ )
2859 ctrls = op->o_tmpalloc( (n + j1 + j2 + 1) * sizeof( LDAPControl * ) + ( j1 + j2 ) * sizeof( LDAPControl ),
2860 op->o_tmpmemctx );
2871 if ( op->o_ctrls ) {
2872 for ( i = 0; op->o_ctrls[ i ]; i++ ) {
2873 ctrls[ i + j1 ] = op->o_ctrls[ i ];
2891 ctrls = op->o_ctrls;
2900 ldap_back_controls_free( Operation *op, SlapReply *rs, LDAPControl ***pctrls )
2905 * so as soon as we find op->o_ctrls[ 0 ] we can stop */
2906 if ( ctrls && ctrls != op->o_ctrls ) {
2915 if ( op->o_ctrls ) {
2916 for ( i = 0; op->o_ctrls[ i ] != NULL; i++ )
2931 op->o_tmpfree( ctrls[ i ]->ldctl_value.bv_val, op->o_tmpmemctx );
2935 op->o_tmpfree( ctrls, op->o_tmpmemctx );