]> git.sur5r.net Git - openldap/commitdiff
fix rewrite stuff
authorPierangelo Masarati <ando@openldap.org>
Sat, 29 Dec 2001 14:18:31 +0000 (14:18 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 29 Dec 2001 14:18:31 +0000 (14:18 +0000)
servers/slapd/back-ldap/search.c

index b3d1547f6fe6f86152c74e387e8f3db1cdae7016..589c85dd078f99907e43d4a362ecd31b8784f036 100644 (file)
@@ -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: