From 6d046b1681fed40559a3c04e8a079cdc5afd7fab Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 29 Dec 2001 14:18:31 +0000 Subject: [PATCH] fix rewrite stuff --- servers/slapd/back-ldap/search.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index b3d1547f6f..589c85dd07 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -390,10 +390,11 @@ ldap_send_entry( * Rewrite the dn of the result, if needed */ switch ( rewrite_session( li->rwinfo, "searchResult", - dn, lc->conn, &ent.e_dn ) ) { + dn, lc->conn, &ent.e_name.bv_val ) ) { case REWRITE_REGEXEC_OK: - if ( ent.e_dn == NULL ) { - ent.e_dn = dn; + if ( ent.e_name.bv_val == NULL ) { + ent.e_name.bv_val = dn; + } else { #ifdef NEW_LOGGING LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, @@ -406,6 +407,7 @@ ldap_send_entry( free( dn ); dn = NULL; } + ent.e_name.bv_len = strlen( ent.e_name.bv_val ); break; case REWRITE_REGEXEC_ERR: -- 2.39.5