]> git.sur5r.net Git - openldap/commitdiff
Update TLS and SASL error reporting
authorKurt Zeilenga <kurt@openldap.org>
Wed, 11 Oct 2000 04:29:12 +0000 (04:29 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 11 Oct 2000 04:29:12 +0000 (04:29 +0000)
CHANGES
libraries/libldap/cyrus.c
libraries/libldap/sasl.c
libraries/libldap/tls.c

diff --git a/CHANGES b/CHANGES
index 7c47f20a6c796727dfd893e2538fe9008ed7afac..493f68d0ddf090d9505ac5c4b3ef8d907a6ef3ed 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
 OpenLDAP 2.0 Change Log
 
 OpenLDAP 2.0.X Engineering
+       Updated -lldap SASL error reporting
+       Updated -lldap TLS error reporting
        Build Environment
                Fixed $(DESTDIR) install (ITS#806)
 
index 9908505699450975db31695893cc0125c1148052..d9fc51e61d2ed3f365c1c75487f467e418d0aee9 100644 (file)
@@ -403,7 +403,7 @@ ldap_int_sasl_open(
        assert( lc->lconn_sasl_ctx == NULL );
 
        if ( host == NULL ) {
-               ld->ld_errno = LDAP_UNAVAILABLE;
+               ld->ld_errno = LDAP_LOCAL_ERROR;
                return ld->ld_errno;
        }
 
@@ -482,13 +482,15 @@ ldap_int_sasl_bind(
 
        if ( sd == AC_SOCKET_INVALID ) {
                /* not connected yet */
-               int rc = ldap_open_defconn( ld );
-  
+               int rc;
+
+               rc = ldap_open_defconn( ld );
                if( rc < 0 ) return ld->ld_errno;
+
                ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, &sd );
 
                if( sd == AC_SOCKET_INVALID ) {
-                       ld->ld_errno = LDAP_UNAVAILABLE;
+                       ld->ld_errno = LDAP_LOCAL_ERROR;
                        return ld->ld_errno;
                }
        }   
@@ -496,7 +498,7 @@ ldap_int_sasl_bind(
        ctx = ld->ld_defconn->lconn_sasl_ctx;
 
        if( ctx == NULL ) {
-               ld->ld_errno = LDAP_UNAVAILABLE;
+               ld->ld_errno = LDAP_LOCAL_ERROR;
                return ld->ld_errno;
        }
 
index a17ca56c9eda4b4e05778c1696a90d276aee583f..e22b11ce96fa47f9859a9e20705a0b37471f5a5e 100644 (file)
@@ -366,24 +366,25 @@ ldap_pvt_sasl_getmechs ( LDAP *ld, char **pmechlist )
                
        e = ldap_first_entry( ld, res );
        if ( e == NULL ) {
+               ldap_msgfree( res );
                if ( ld->ld_errno == LDAP_SUCCESS ) {
-                       ld->ld_errno = LDAP_UNAVAILABLE;
+                       ld->ld_errno = LDAP_NO_SUCH_OBJECT;
                }
                return ld->ld_errno;
        }
 
        values = ldap_get_values( ld, e, "supportedSASLMechanisms" );
        if ( values == NULL ) {
-               ld->ld_errno = LDAP_NO_SUCH_ATTRIBUTE;
                ldap_msgfree( res );
+               ld->ld_errno = LDAP_NO_SUCH_ATTRIBUTE;
                return ld->ld_errno;
        }
 
        mechlist = ldap_charray2str( values, " " );
        if ( mechlist == NULL ) {
-               ld->ld_errno = LDAP_NO_MEMORY;
                LDAP_VFREE( values );
                ldap_msgfree( res );
+               ld->ld_errno = LDAP_NO_MEMORY;
                return ld->ld_errno;
        } 
 
index 723b85ffa4deabf1c527231d16b10a0f7399db97..3b1000cc98dbe9d5afeb5919b1d70857e60443f4 100644 (file)
@@ -1010,7 +1010,7 @@ tls_seed_PRNG( const char *randfile )
 
        if (randfile == NULL) {
                Debug( LDAP_DEBUG_ANY,
-                       "TLS: Use configuration file or $RANDFILE to define seed PRNG",
+                       "TLS: Use configuration file or $RANDFILE to define seed PRNG\n",
                        0, 0, 0);
                return -1;
        }
@@ -1019,7 +1019,7 @@ tls_seed_PRNG( const char *randfile )
 
        if (RAND_status() == 0) {
                Debug( LDAP_DEBUG_ANY,
-                       "TLS: PRNG not been seeded with enough data",
+                       "TLS: PRNG not been seeded with enough data\n",
                        0, 0, 0);
                return -1;
        }