]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/kbind.c
Minor adjustments based upon initial read of draft-ietf-ldapext-ldap-c-api-04.txt.
[openldap] / libraries / libldap / kbind.c
index 5e63698ddc7e2d4fbf58fe7286a97d05cbc224c7..0c6a07931b0719355daa60c18e09b2c28d7f0e88 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
@@ -272,6 +273,13 @@ ldap_get_kerberosv4_credentials(
                return( NULL );
        }
 
+       if( ! ber_pvt_sb_in_use( &ld->ld_sb ) ) {
+               /* not connected yet */
+               int rc = ldap_open_defconn( ld );
+
+               if( rc < 0 ) return NULL;
+       }
+
        krbinstance = ld->ld_defconn->lconn_krbinstance;
 
        if ( (err = krb_mk_req( &ktxt, service, krbinstance, realm, 0 ))