From: Kurt Zeilenga Date: Mon, 17 Jul 2000 21:36:30 +0000 (+0000) Subject: Fix SASL automatic/quiet modes... X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2429 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9fb680d52704c067f6e4ec1bb99ca8cbbdcc0585;p=openldap Fix SASL automatic/quiet modes... --- diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 3349fc9942..aa1c677b58 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -600,12 +600,12 @@ ldap_int_sasl_bind( 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 ); } } diff --git a/libraries/liblutil/sasl.c b/libraries/liblutil/sasl.c index 743758f815..1a09e655eb 100644 --- a/libraries/liblutil/sasl.c +++ b/libraries/liblutil/sasl.c @@ -101,7 +101,9 @@ static int interaction( 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; } @@ -184,7 +186,7 @@ int lutil_sasl_interact( { sasl_interact_t *interact = in; - if( flags != LDAP_SASL_QUIET ) { + if( flags == LDAP_SASL_INTERACTIVE ) { fputs( "SASL Interaction\n", stderr ); }