mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-27 01:59:38 -05:00
Round 2
This commit is contained in:
parent
182f6e20c3
commit
c3a43e2c4f
2 changed files with 11 additions and 10 deletions
|
|
@ -529,6 +529,7 @@ ldap_int_sasl_bind(
|
|||
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;
|
||||
|
|
@ -589,6 +590,8 @@ ldap_int_sasl_bind(
|
|||
&credlen,
|
||||
&mech );
|
||||
|
||||
if( promptresult == NULL && prompts != NULL ) prompts->result = NULL;
|
||||
|
||||
if( pmech == NULL && mech != NULL ) {
|
||||
pmech = mech;
|
||||
|
||||
|
|
@ -603,6 +606,7 @@ ldap_int_sasl_bind(
|
|||
int res;
|
||||
if( !interact ) break;
|
||||
res = (interact)( ld, flags, defaults, prompts );
|
||||
promptresult = prompts->result;
|
||||
if( res != LDAP_SUCCESS ) break;
|
||||
}
|
||||
} while ( saslrc == SASL_INTERACT );
|
||||
|
|
@ -678,6 +682,8 @@ ldap_int_sasl_bind(
|
|||
(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 );
|
||||
|
|
@ -690,6 +696,7 @@ ldap_int_sasl_bind(
|
|||
int res;
|
||||
if( !interact ) break;
|
||||
res = (interact)( ld, flags, defaults, prompts );
|
||||
promptresult = prompts->result;
|
||||
if( res != LDAP_SUCCESS ) break;
|
||||
}
|
||||
} while ( saslrc == SASL_INTERACT );
|
||||
|
|
@ -749,11 +756,7 @@ ldap_int_sasl_bind(
|
|||
}
|
||||
|
||||
done:
|
||||
if( interact ) {
|
||||
/* cleanup */
|
||||
(void) (interact)( NULL, 0, NULL, prompts );
|
||||
}
|
||||
|
||||
LDAP_FREE((void*)promptresult);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -190,15 +190,13 @@ int lutil_sasl_interact(
|
|||
{
|
||||
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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue