mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#3298 - ldap_sasl_int_bind() refers to incorrect Sockbuf when called
from within a rebind function.
This commit is contained in:
parent
4fdefa106f
commit
842fe3091a
@ -603,7 +603,7 @@ ldap_int_sasl_bind(
|
|||||||
rc = ldap_open_defconn( ld );
|
rc = ldap_open_defconn( ld );
|
||||||
if( rc < 0 ) return ld->ld_errno;
|
if( rc < 0 ) return ld->ld_errno;
|
||||||
|
|
||||||
ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, &sd );
|
ber_sockbuf_ctrl( ld->ld_defconn->lconn_sb, LBER_SB_OPT_GET_FD, &sd );
|
||||||
|
|
||||||
if( sd == AC_SOCKET_INVALID ) {
|
if( sd == AC_SOCKET_INVALID ) {
|
||||||
ld->ld_errno = LDAP_LOCAL_ERROR;
|
ld->ld_errno = LDAP_LOCAL_ERROR;
|
||||||
@ -621,7 +621,7 @@ ldap_int_sasl_bind(
|
|||||||
ld->ld_defconn->lconn_sasl_authctx = NULL;
|
ld->ld_defconn->lconn_sasl_authctx = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
{ char *saslhost = ldap_host_connected_to( ld->ld_sb, "localhost" );
|
{ char *saslhost = ldap_host_connected_to( ld->ld_defconn->lconn_sb, "localhost" );
|
||||||
rc = ldap_int_sasl_open( ld, ld->ld_defconn, saslhost );
|
rc = ldap_int_sasl_open( ld, ld->ld_defconn, saslhost );
|
||||||
LDAP_FREE( saslhost );
|
LDAP_FREE( saslhost );
|
||||||
}
|
}
|
||||||
@ -631,7 +631,7 @@ ldap_int_sasl_bind(
|
|||||||
ctx = ld->ld_defconn->lconn_sasl_authctx;
|
ctx = ld->ld_defconn->lconn_sasl_authctx;
|
||||||
|
|
||||||
/* Check for TLS */
|
/* Check for TLS */
|
||||||
ssl = ldap_pvt_tls_sb_ctx( ld->ld_sb );
|
ssl = ldap_pvt_tls_sb_ctx( ld->ld_defconn->lconn_sb );
|
||||||
if ( ssl ) {
|
if ( ssl ) {
|
||||||
struct berval authid = BER_BVNULL;
|
struct berval authid = BER_BVNULL;
|
||||||
ber_len_t fac;
|
ber_len_t fac;
|
||||||
@ -831,7 +831,7 @@ ldap_int_sasl_bind(
|
|||||||
if ( ld->ld_defconn->lconn_sasl_sockctx ) {
|
if ( ld->ld_defconn->lconn_sasl_sockctx ) {
|
||||||
oldctx = ld->ld_defconn->lconn_sasl_sockctx;
|
oldctx = ld->ld_defconn->lconn_sasl_sockctx;
|
||||||
sasl_dispose( &oldctx );
|
sasl_dispose( &oldctx );
|
||||||
ldap_pvt_sasl_remove( ld->ld_sb );
|
ldap_pvt_sasl_remove( ld->ld_defconn->lconn_sb );
|
||||||
}
|
}
|
||||||
ldap_pvt_sasl_install( ld->ld_conns->lconn_sb, ctx );
|
ldap_pvt_sasl_install( ld->ld_conns->lconn_sb, ctx );
|
||||||
ld->ld_defconn->lconn_sasl_sockctx = ctx;
|
ld->ld_defconn->lconn_sasl_sockctx = ctx;
|
||||||
|
Loading…
Reference in New Issue
Block a user