sasl_ssf_t *ssf = NULL;
sasl_conn_t *ctx;
sasl_interact_t *prompts = NULL;
+ const void *promptresult = NULL;
unsigned credlen;
struct berval ccred;
ber_socket_t sd;
&credlen,
&mech );
+ if( promptresult == NULL && prompts != NULL ) prompts->result = NULL;
+
if( pmech == NULL && mech != NULL ) {
pmech = mech;
int res;
if( !interact ) break;
res = (interact)( ld, flags, defaults, prompts );
+ promptresult = prompts->result;
if( res != LDAP_SUCCESS ) break;
}
} while ( saslrc == SASL_INTERACT );
(SASL_CONST char **)&ccred.bv_val,
&credlen );
+ if( promptresult == NULL && prompts != NULL ) prompts->result = NULL;
+
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc,0,0 );
int res;
if( !interact ) break;
res = (interact)( ld, flags, defaults, prompts );
+ promptresult = prompts->result;
if( res != LDAP_SUCCESS ) break;
}
} while ( saslrc == SASL_INTERACT );
}
done:
- if( interact ) {
- /* cleanup */
- (void) (interact)( NULL, 0, NULL, prompts );
- }
-
+ LDAP_FREE((void*)promptresult);
return rc;
}
{
sasl_interact_t *interact = in;
- if( interact && interact->result ) {
+ if( interact->result ) {
/* we have results from a previous interaction */
- free( interact->result );
+ free( (void *)interact->result );
interact->result = NULL;
}
- if( ld == NULL ) {
- return LDAP_SUCCESS;
- }
+ if( ld == NULL ) return LDAP_PARAM_ERROR;
if( flags == LDAP_SASL_INTERACTIVE ) {
fputs( "SASL Interaction\n", stderr );