- if ( (*be->be_bind)( be, conn, op, dn, method, &cred ) == 0 ) {
- pthread_mutex_lock( &conn->c_dnmutex );
+ /* alias suffix */
+ char *edn;
+
+ ndn = suffixAlias( ndn, op, be );
+
+ if ( (*be->be_bind)( be, conn, op, ndn, method, &cred, &edn ) == 0 ) {
+ ldap_pvt_thread_mutex_lock( &conn->c_dnmutex );
+
+ conn->c_protocol = version;
+
+ if ( conn->c_cdn != NULL ) {
+ free( conn->c_cdn );
+ }
+
+ conn->c_cdn = cdn;
+ cdn = NULL;
+