X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-ldap%2Fbind.c;h=92d5856fa1ff00c248a15e707f036e3d4ad69d10;hb=82540c5cc1be5bf17b22f3a41d12d1bc56180654;hp=2c1af55ef793c2da2059f3bb7f9c11bee4a9dc92;hpb=c7262c7599eb883d5b28a1dbf64e9883cb17a851;p=openldap diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 2c1af55ef7..92d5856fa1 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -84,8 +84,8 @@ ldap_back_bind( mdn.bv_val = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> bindDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn.bv_val, "" ); @@ -98,7 +98,7 @@ ldap_back_bind( return( -1 ); case REWRITE_REGEXEC_ERR: - send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, + send_ldap_result( conn, op, LDAP_OTHER, NULL, "Operations error", NULL, NULL ); return( -1 ); } @@ -242,7 +242,7 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) ( void )rewrite_session_init( li->rwinfo, conn ); #endif /* ENABLE_REWRITE */ - if ( lc->conn->c_cdn.bv_len != 0 ) { + if ( lc->conn->c_dn.bv_len != 0 ) { /* * Rewrite the bind dn if needed @@ -251,23 +251,23 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) lc->bound_dn.bv_val = NULL; lc->bound_dn.bv_len = 0; switch ( rewrite_session( li->rwinfo, "bindDn", - lc->conn->c_cdn.bv_val, conn, + lc->conn->c_dn.bv_val, conn, &lc->bound_dn.bv_val ) ) { case REWRITE_REGEXEC_OK: if ( lc->bound_dn.bv_val == NULL ) { - ber_dupbv( &lc->bound_dn, &lc->conn->c_cdn ); + ber_dupbv( &lc->bound_dn, &lc->conn->c_dn ); } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn: \"%s\" ->" + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] bindDn: \"%s\" ->" " \"%s\"\n%s", - lc->conn->c_cdn.bv_val, - lc->bound_dn.bv_val )); + lc->conn->c_dn.bv_val, + lc->bound_dn.bv_val, "" ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> bindDn: \"%s\" ->" " \"%s\"\n%s", - lc->conn->c_cdn.bv_val, + lc->conn->c_dn.bv_val, lc->bound_dn.bv_val, "" ); #endif /* !NEW_LOGGING */ break; @@ -281,15 +281,15 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) case REWRITE_REGEXEC_ERR: send_ldap_result( conn, op, - LDAP_OPERATIONS_ERROR, + LDAP_OTHER, NULL, "Operations error", NULL, NULL ); return( NULL ); } #else /* !ENABLE_REWRITE */ struct berval bv; - ldap_back_dn_massage( li, &lc->conn->c_cdn, &bv, 0, 1 ); - if ( bv.bv_val == lc->conn->c_cdn.bv_val ) + ldap_back_dn_massage( li, &lc->conn->c_dn, &bv, 0, 1 ); + if ( bv.bv_val == lc->conn->c_dn.bv_val ) ber_dupbv( &lc->bound_dn, &bv ); else lc->bound_dn = bv; @@ -312,9 +312,8 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) ldap_pvt_thread_mutex_unlock( &li->conn_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldap_back_getconn: conn %ld inserted\n", - lc->conn->c_connid )); + LDAP_LOG( BACK_LDAP, INFO, + "ldap_back_getconn: conn %ld inserted\n", lc->conn->c_connid, 0, 0); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>ldap_back_getconn: conn %ld inserted\n%s%s", @@ -323,16 +322,16 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) /* Err could be -1 in case a duplicate ldapconn is inserted */ if ( err != 0 ) { - send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, + send_ldap_result( conn, op, LDAP_OTHER, NULL, "internal server error", NULL, NULL ); /* better destroy the ldapconn struct? */ return( NULL ); } } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldap_back_getconn: conn %ld inserted\n", - lc->conn->c_connid )); + LDAP_LOG( BACK_LDAP, INFO, + "ldap_back_getconn: conn %ld inserted\n", + lc->conn->c_connid, 0, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>ldap_back_getconn: conn %ld fetched%s%s\n", @@ -390,7 +389,7 @@ ldap_back_map_result(int err) case LDAP_SERVER_DOWN: return LDAP_UNAVAILABLE; case LDAP_LOCAL_ERROR: - return LDAP_OPERATIONS_ERROR; + return LDAP_OTHER; case LDAP_ENCODING_ERROR: case LDAP_DECODING_ERROR: return LDAP_PROTOCOL_ERROR; @@ -399,13 +398,13 @@ ldap_back_map_result(int err) case LDAP_AUTH_UNKNOWN: return LDAP_AUTH_METHOD_NOT_SUPPORTED; case LDAP_FILTER_ERROR: - return LDAP_OPERATIONS_ERROR; + return LDAP_OTHER; case LDAP_USER_CANCELLED: - return LDAP_OPERATIONS_ERROR; + return LDAP_OTHER; case LDAP_PARAM_ERROR: return LDAP_PROTOCOL_ERROR; case LDAP_NO_MEMORY: - return LDAP_OPERATIONS_ERROR; + return LDAP_OTHER; case LDAP_CONNECT_ERROR: return LDAP_UNAVAILABLE; case LDAP_NOT_SUPPORTED: