/*
* If the connection dn is not null, an attempt to rewrite it is made
*/
- if ( conn->c_cdn != 0 ) {
- char *mdn = NULL;
+ if ( conn->c_dn.bv_len != 0 ) {
/*
* Rewrite the bind dn if needed
*/
- lsc->bound_dn = NULL;
+ lsc->bound_dn.bv_val = NULL;
switch ( rewrite_session( lt->rwinfo, "bindDn",
- conn->c_cdn, conn, &mdn ) ) {
+ conn->c_dn.bv_val, conn,
+ &lsc->bound_dn.bv_val ) ) {
case REWRITE_REGEXEC_OK:
- if ( mdn == NULL ) {
- lsc->bound_dn = ber_bvstrdup( conn->c_cdn );
+ if ( lsc->bound_dn.bv_val == NULL ) {
+ ber_dupbv( &lsc->bound_dn, &conn->c_dn );
}
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "[rw] bindDn: \"%s\" -> \"%s\"\n",
- conn->c_cdn, lsc->bound_dn->bv_val ));
+ LDAP_LOG( BACK_META, DETAIL1,
+ "[rw] bindDn: \"%s\" -> \"%s\"\n",
+ conn->c_dn.bv_val, lsc->bound_dn.bv_val, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"rw> bindDn: \"%s\" -> \"%s\"\n",
- conn->c_cdn, lsc->bound_dn->bv_val, 0 );
+ conn->c_dn.bv_val, lsc->bound_dn.bv_val, 0 );
#endif /* !NEW_LOGGING */
break;
return LDAP_OPERATIONS_ERROR;
}
- if ( mdn ) {
- lsc->bound_dn = ber_bvstr( mdn );
- } else {
- lsc->bound_dn = ber_bvstrdup( "" );
- }
+ assert( lsc->bound_dn.bv_val );
} else {
- lsc->bound_dn = ber_bvstrdup( "" );
+ ber_str2bv( "", 0, 1, &lsc->bound_dn );
}
lsc->bound = META_UNBOUND;
}
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "meta_back_getconn: got target %d"
- " for ndn=\"%s\" from cache\n",
- i, ndn->bv_val ));
+ LDAP_LOG( BACK_META, INFO,
+ "meta_back_getconn: got target %d for ndn=\"%s\" from cache\n",
+ i, ndn->bv_val, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_CACHE,
"==>meta_back_getconn: got target %d for ndn=\"%s\" from cache\n%s",
ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "meta_back_getconn: conn %ld inserted\n",
- lc->conn->c_connid ));
+ LDAP_LOG( BACK_META, INFO,
+ "meta_back_getconn: conn %ld inserted\n", lc->conn->c_connid, 0, 0);
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>meta_back_getconn: conn %ld inserted\n%s%s",
}
} else {
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "meta_back_getconn: conn %ld fetched\n",
- lc->conn->c_connid ));
+ LDAP_LOG( BACK_META, INFO,
+ "meta_back_getconn: conn %ld fetched\n", lc->conn->c_connid, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>meta_back_getconn: conn %ld fetched\n%s%s",