]> git.sur5r.net Git - openldap/commitdiff
ITS#717 kbind fixes
authorKurt Zeilenga <kurt@openldap.org>
Wed, 6 Sep 2000 21:32:45 +0000 (21:32 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 6 Sep 2000 21:32:45 +0000 (21:32 +0000)
libraries/libldap/ldap-int.h
libraries/libldap/open.c
libraries/libldap/request.c

index 3c8ed212891801bc94fa692b9bc2b877cc0a231d..ebb7fc4dffd41ec28371c292fa21c2b8fec9c85d 100644 (file)
@@ -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;
index 658c86fac20b0e8c4b94fe8471385113f691ee45..ee9009f05206af5e882dd920b36868501feafd7a 100644 (file)
@@ -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 );
 }
index 7ca2c675c9d7e787c2e68c2ea2c85b28d103dd5f..91ac6d0761a4e27a4d2247d6bde332854d4026f1 100644 (file)
@@ -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 );
                }