]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/sasl.c
integer indexing must be unsigned
[openldap] / servers / slapd / sasl.c
index 9e019fdec0bc91a64c34d6d965b8f12528c6c02a..7a757872f6cf83a6de9493f4915a23cf1a2f3125 100644 (file)
@@ -455,6 +455,7 @@ slap_auxprop_store(
                mod->sml_op = LDAP_MOD_REPLACE;
                mod->sml_flags = 0;
                ber_str2bv( pr[i].name, 0, 0, &mod->sml_type );
+               mod->sml_numvals = pr[i].nvalues;
                mod->sml_values = (struct berval *)ch_malloc( (pr[i].nvalues + 1) *
                        sizeof(struct berval));
                for (j=0; j<pr[i].nvalues; j++) {
@@ -1278,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;
 }
@@ -1388,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 );
@@ -1397,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
 
@@ -1447,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;
@@ -1621,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 );