From: Pierangelo Masarati Date: Sat, 29 Dec 2001 14:18:31 +0000 (+0000) Subject: fix rewrite stuff X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~414 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6d046b1681fed40559a3c04e8a079cdc5afd7fab;p=openldap fix rewrite stuff --- 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: