From: Howard Chu Date: Wed, 21 Jan 2004 09:03:23 +0000 (+0000) Subject: Import ITS#2717 SASL_MECH fix from HEAD X-Git-Tag: OPENLDAP_REL_ENG_2_1_26~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1738a87190ad09af9dbf2d71e62f683ac3b08a4c;p=thirdparty%2Fopenldap.git Import ITS#2717 SASL_MECH fix from HEAD --- diff --git a/libraries/libldap/sasl.c b/libraries/libldap/sasl.c index 2e7a0841b7..ebe2fea420 100644 --- a/libraries/libldap/sasl.c +++ b/libraries/libldap/sasl.c @@ -427,6 +427,7 @@ ldap_sasl_interactive_bind_s( void *defaults ) { int rc; + char *smechs = NULL; #if defined( LDAP_R_COMPILE ) && defined( HAVE_CYRUS_SASL ) ldap_pvt_thread_mutex_lock( &ldap_int_sasl_mutex ); @@ -441,9 +442,14 @@ ldap_sasl_interactive_bind_s( return rc < 0 ? rc : 0; } else #endif + +#ifdef HAVE_CYRUS_SASL if( mechs == NULL || *mechs == '\0' ) { - char *smechs; + mechs = ld->ld_options.ldo_def_sasl_mech; + } +#endif + if( mechs == NULL || *mechs == '\0' ) { rc = ldap_pvt_sasl_getmechs( ld, &smechs ); if( rc != LDAP_SUCCESS ) { @@ -481,6 +487,7 @@ done: #if defined( LDAP_R_COMPILE ) && defined( HAVE_CYRUS_SASL ) ldap_pvt_thread_mutex_unlock( &ldap_int_sasl_mutex ); #endif + if ( smechs ) LDAP_FREE( smechs ); return rc; }