]> git.sur5r.net Git - openldap/commitdiff
take care of DN-valued "operational" (generated) attrs
authorPierangelo Masarati <ando@openldap.org>
Sun, 30 Jan 2005 22:00:09 +0000 (22:00 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 30 Jan 2005 22:00:09 +0000 (22:00 +0000)
servers/slapd/overlays/rwm.c

index d9ca042554945b0fef7b05c07cfd9004f7c6080a..10aeea9736815790bdae1a7d9a05b54816f2dfe2 100644 (file)
@@ -785,7 +785,7 @@ rwm_matched( Operation *op, SlapReply *rs )
 }
 
 static int
-rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
+rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first, int stripEntryDN )
 {
        slap_overinst           *on = (slap_overinst *) op->o_bd->bd_info;
        struct ldaprwmap        *rwmap = 
@@ -852,11 +852,13 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
                }
 
                if ( (*ap)->a_desc == slap_schema.si_ad_entryDN ) {
-                       /* will be generated by frontend */
-                       goto cleanup_attr;
-               }
-
-               if ( !isupdate && (*ap)->a_desc->ad_type->sat_no_user_mod 
+                       if ( stripEntryDN ) {
+                               /* will be generated by frontend */
+                               goto cleanup_attr;
+                       }
+                       
+               } else if ( !isupdate
+                       && (*ap)->a_desc->ad_type->sat_no_user_mod 
                        && (*ap)->a_desc->ad_type != slap_schema.si_at_undefined )
                {
                        goto next_attr;
@@ -1029,7 +1031,11 @@ rwm_send_entry( Operation *op, SlapReply *rs )
        /* FIXME: the entries are in the remote mapping form;
         * so we need to select those attributes we are willing
         * to return, and remap them accordingly */
-       (void)rwm_attrs( op, rs, &e->e_attrs );
+       (void)rwm_attrs( op, rs, &e->e_attrs, 1 );
+
+       if ( rs->sr_operational_attrs ) {
+               (void)rwm_attrs( op, rs, &rs->sr_operational_attrs, 0 );
+       }
 
        rs->sr_entry = e;
        rs->sr_flags = flags;
@@ -1059,7 +1065,7 @@ rwm_operational( Operation *op, SlapReply *rs )
         * so we need to select those attributes we are willing
         * to return, and remap them accordingly */
        if ( rs->sr_operational_attrs ) {
-               rwm_attrs( op, rs, &rs->sr_operational_attrs );
+               rwm_attrs( op, rs, &rs->sr_operational_attrs, 1 );
        }
 
        return SLAP_CB_CONTINUE;