if( flags != LDAP_SASL_QUIET ) {
saslrc = sasl_getprop( ctx, SASL_USERNAME, (void **) &data );
- if( saslrc == SASL_OK ) {
+ if( saslrc == SASL_OK && data && *data ) {
fprintf( stderr, "SASL username: %s\n", data );
}
saslrc = sasl_getprop( ctx, SASL_REALM, (void **) &data );
- if( saslrc == SASL_OK ) {
+ if( saslrc == SASL_OK && data && *data ) {
fprintf( stderr, "SASL realm: %s\n", data );
}
}
if( dflt && !*dflt ) dflt = NULL;
- if( flags != LDAP_SASL_INTERACTIVE && dflt ) {
+ if( flags != LDAP_SASL_INTERACTIVE &&
+ ( dflt || interact->id == SASL_CB_USER ) )
+ {
goto use_default;
}
{
sasl_interact_t *interact = in;
- if( flags != LDAP_SASL_QUIET ) {
+ if( flags == LDAP_SASL_INTERACTIVE ) {
fputs( "SASL Interaction\n", stderr );
}