From b3f366e0ba706db907b8bc1c239affd639ee179f Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 11 Aug 2005 15:13:29 +0000 Subject: [PATCH] essentially address 3791 with a reworked patch --- libraries/libldap/tls.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 4f7a08b9e6..5e43f8aeb6 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -831,10 +831,14 @@ int ldap_tls_inplace( LDAP *ld ) { Sockbuf *sb = NULL; - int rc; - rc = ldap_get_option( ld, LDAP_OPT_SOCKBUF, (void *)&sb ); - if ( rc != LDAP_SUCCESS || sb == NULL ) { + if ( ld->ld_defconn && ld->ld_defconn->lconn_sb ) { + sb = ld->ld_defconn->lconn_sb; + + } else if ( ld->ld_sb ) { + sb = ld->ld_sb; + + } else { return 0; } @@ -1681,7 +1685,7 @@ ldap_install_tls( LDAP *ld ) #ifndef HAVE_TLS return LDAP_NOT_SUPPORTED; #else - if ( ld->ld_sb != NULL && ldap_pvt_tls_inplace( ld->ld_sb ) != 0 ) { + if ( ldap_tls_inplace( ld ) ) { return LDAP_LOCAL_ERROR; } @@ -1703,7 +1707,7 @@ ldap_start_tls_s ( LDAP *ld, /* XXYYZ: this initiates operation only on default connection! */ - if ( ld->ld_sb != NULL && ldap_pvt_tls_inplace( ld->ld_sb ) != 0 ) { + if ( ldap_tls_inplace( ld ) ) { return LDAP_LOCAL_ERROR; } -- 2.39.5