X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fsasl.c;h=2d47636b7c175e6dca2c4ad209451228ae2d26e9;hb=966616b274d24c45b1f3a71ff35ddd502153b4a1;hp=e22b11ce96fa47f9859a9e20705a0b37471f5a5e;hpb=b7b9148c7fef33815e4a5510bccb5604cb7aced5;p=openldap diff --git a/libraries/libldap/sasl.c b/libraries/libldap/sasl.c index e22b11ce96..2d47636b7c 100644 --- a/libraries/libldap/sasl.c +++ b/libraries/libldap/sasl.c @@ -37,7 +37,6 @@ #include "ldap-int.h" - /* * ldap_sasl_bind - bind to the ldap server (and X.500). * The dn (usually NULL), mechanism, and credentials are provided. @@ -68,6 +67,10 @@ ldap_sasl_bind( assert( LDAP_VALID( ld ) ); assert( msgidp != NULL ); + /* check client controls */ + rc = ldap_int_client_controls( ld, cctrls ); + if( rc != LDAP_SUCCESS ) return rc; + if( msgidp == NULL ) { ld->ld_errno = LDAP_PARAM_ERROR; return ld->ld_errno; @@ -94,7 +97,7 @@ ldap_sasl_bind( return ld->ld_errno; } - assert( BER_VALID( ber ) ); + assert( LBER_VALID( ber ) ); if( mechanism == LDAP_SASL_SIMPLE ) { /* simple bind */ @@ -417,13 +420,17 @@ ldap_sasl_interactive_bind_s( { int rc; +#if defined( LDAP_R_COMPILE ) && defined( HAVE_CYRUS_SASL ) + ldap_pvt_thread_mutex_lock( &ldap_int_sasl_mutex ); +#endif + if( mechs == NULL || *mechs == '\0' ) { char *smechs; rc = ldap_pvt_sasl_getmechs( ld, &smechs ); if( rc != LDAP_SUCCESS ) { - return rc; + goto done; } Debug( LDAP_DEBUG_TRACE, @@ -442,5 +449,10 @@ ldap_sasl_interactive_bind_s( serverControls, clientControls, flags, interact, defaults ); +done: +#if defined( LDAP_R_COMPILE ) && defined( HAVE_CYRUS_SASL ) + ldap_pvt_thread_mutex_unlock( &ldap_int_sasl_mutex ); +#endif + return rc; }