From 102a88659b421508dedfcfa4e7f3b55a6dfbf893 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 6 Sep 2000 21:32:45 +0000 Subject: [PATCH] ITS#717 kbind fixes --- libraries/libldap/ldap-int.h | 2 ++ libraries/libldap/open.c | 6 ++---- libraries/libldap/request.c | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index 3c8ed21289..ebb7fc4dff 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -181,7 +181,9 @@ typedef struct ldap_conn { #define LDAP_CONNST_CONNECTING 2 #define LDAP_CONNST_CONNECTED 3 LDAPURLDesc *lconn_server; +#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND char *lconn_krbinstance; +#endif struct ldap_conn *lconn_next; BerElement *lconn_ber;/* ber receiving on this conn. */ } LDAPConn; diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 658c86fac2..ee9009f052 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -322,8 +322,8 @@ ldap_int_open_connection( } #endif - if ( conn->lconn_krbinstance != NULL ) { #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND + if ( conn->lconn_krbinstance == NULL ) { char *c; conn->lconn_krbinstance = ldap_host_connected_to( conn->sb ); @@ -331,10 +331,8 @@ ldap_int_open_connection( ( c = strchr( conn->lconn_krbinstance, '.' )) != NULL ) { *c = '\0'; } -#else /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */ - conn->lconn_krbinstance = NULL; -#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */ } +#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */ return( 0 ); } diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 7ca2c675c9..91ac6d0761 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -410,9 +410,11 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) prevlc = tmplc; } ldap_free_urllist( lc->lconn_server ); +#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND if ( lc->lconn_krbinstance != NULL ) { LDAP_FREE( lc->lconn_krbinstance ); } +#endif if ( lc->lconn_sb != ld->ld_sb ) { ber_sockbuf_free( lc->lconn_sb ); } -- 2.39.5