/* bind.c - decode an ldap bind operation and pass it to a backend db */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
* }
*/
- tag = ber_scanf( ber, "{iot" /*}*/, &version, &dn, &method );
+ tag = ber_scanf( ber, "{imt" /*}*/, &version, &dn, &method );
if ( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
op->o_protocol = version;
if( method != LDAP_AUTH_SASL ) {
- tag = ber_scanf( ber, /*{*/ "o}", &cred );
+ tag = ber_scanf( ber, /*{*/ "m}", &cred );
} else {
tag = ber_scanf( ber, "{a" /*}*/, &mech );
tag = ber_peek_tag( ber, &len );
if ( tag == LDAP_TAG_LDAPCRED ) {
- tag = ber_scanf( ber, "o", &cred );
+ tag = ber_scanf( ber, "m", &cred );
} else {
tag = LDAP_TAG_LDAPCRED;
cred.bv_val = NULL;
conn->c_protocol = version;
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
+ /* check for inappropriate controls */
+ if( get_manageDSAit( op ) == SLAP_CRITICAL_CONTROL ) {
+ send_ldap_result( conn, op,
+ rc = LDAP_UNAVAILABLE_CRITICAL_EXTENSION,
+ NULL, "manageDSAit control inappropriate",
+ NULL, NULL );
+ goto cleanup;
+ }
+
if ( method == LDAP_AUTH_SASL ) {
char *edn;
slap_ssf_t ssf = 0;
goto cleanup;
}
- if( mech == NULL || *mech == '\0' ) {
+ if( mech == NULL || mech[0] == '\0' ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_bind: conn %d no SASL mechanism provided\n",
} else {
ber_dupbv( &conn->c_dn, &pdn );
}
- conn->c_cdn = pdn.bv_val;
+ conn->c_cdn = pdn;
pdn.bv_val = NULL;
pdn.bv_len = 0;
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"do_bind: conn %d v%d bind: \"%s\" to \"%s\" \n",
- conn->c_connid, version, conn->c_cdn, conn->c_dn.bv_val ));
+ conn->c_connid, version, conn->c_cdn.bv_val, conn->c_dn.bv_val ));
#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: v%d bind: \"%s\" to \"%s\"\n",
- version, conn->c_cdn, conn->c_dn.bv_val );
+ version, conn->c_cdn.bv_val, conn->c_dn.bv_val );
#endif
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
}
cleanup:
- free( dn.bv_val );
if( pdn.bv_val != NULL ) {
free( pdn.bv_val );
}
if ( mech != NULL ) {
free( mech );
}
- if ( cred.bv_val != NULL ) {
- free( cred.bv_val );
- }
return rc;
}