]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/sasl.c
integer indexing must be unsigned
[openldap] / servers / slapd / sasl.c
index d9a604efc1e08a2f9740e28505fc3b72ed7eba76..7a757872f6cf83a6de9493f4915a23cf1a2f3125 100644 (file)
@@ -1279,8 +1279,8 @@ int slap_sasl_destroy( void )
 #ifdef HAVE_CYRUS_SASL
        sasl_done();
 #endif
-       free( global_host );
-       global_host = NULL;
+       free( sasl_host );
+       sasl_host = NULL;
 
        return 0;
 }
@@ -1389,7 +1389,7 @@ int slap_sasl_open( Connection *conn, int reopen )
                ipremoteport = slap_sasl_peer2ipport( &conn->c_peer_name );
        }
 
-       sc = sasl_server_new( "ldap", global_host, global_realm,
+       sc = sasl_server_new( "ldap", sasl_host, global_realm,
                iplocalport, ipremoteport, session_callbacks, SASL_SUCCESS_DATA, &ctx );
        if ( iplocalport != NULL ) {
                ch_free( iplocalport );
@@ -1398,7 +1398,7 @@ int slap_sasl_open( Connection *conn, int reopen )
                ch_free( ipremoteport );
        }
 #else
-       sc = sasl_server_new( "ldap", global_host, global_realm,
+       sc = sasl_server_new( "ldap", sasl_host, global_realm,
                session_callbacks, SASL_SECURITY_LAYER, &ctx );
 #endif
 
@@ -1448,12 +1448,13 @@ int slap_sasl_external(
 #if SASL_VERSION_MAJOR >= 2
        int sc;
        sasl_conn_t *ctx = conn->c_sasl_authctx;
+       sasl_ssf_t sasl_ssf = ssf;
 
        if ( ctx == NULL ) {
                return LDAP_UNAVAILABLE;
        }
 
-       sc = sasl_setprop( ctx, SASL_SSF_EXTERNAL, &ssf );
+       sc = sasl_setprop( ctx, SASL_SSF_EXTERNAL, &sasl_ssf );
 
        if ( sc != SASL_OK ) {
                return LDAP_OTHER;
@@ -1622,7 +1623,7 @@ int slap_sasl_bind( Operation *op, SlapReply *rs )
        if ( !op->o_conn->c_sasl_bind_in_progress ) {
                /* If we already authenticated once, must use a new context */
                if ( op->o_conn->c_sasl_done ) {
-                       slap_ssf_t ssf = 0;
+                       sasl_ssf_t ssf = 0;
                        const char *authid = NULL;
 #if SASL_VERSION_MAJOR >= 2
                        sasl_getprop( ctx, SASL_SSF_EXTERNAL, (void *)&ssf );