From 9fb680d52704c067f6e4ec1bb99ca8cbbdcc0585 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 17 Jul 2000 21:36:30 +0000 Subject: [PATCH] Fix SASL automatic/quiet modes... --- libraries/libldap/cyrus.c | 4 ++-- libraries/liblutil/sasl.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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 ); } -- 2.39.5