From: Kurt Zeilenga Date: Wed, 6 Sep 2000 21:32:45 +0000 (+0000) Subject: ITS#717 kbind fixes X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2083 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=102a88659b421508dedfcfa4e7f3b55a6dfbf893;p=openldap ITS#717 kbind fixes --- 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 ); }