]> git.sur5r.net Git - openldap/blobdiff - contrib/slapd-modules/cloak/cloak.c
ITS#6758 Use rs_*() to manage SlapReply entries.
[openldap] / contrib / slapd-modules / cloak / cloak.c
index 03c9c09f9121638114dbeae955480a57320df4a3..b6746e9ce86ea355a90db67c1a2c7c53d23bd95f 100644 (file)
@@ -221,10 +221,8 @@ cloak_search_cb( Operation *op, SlapReply *rs )
        /*
         * We are now committed to cloak an attribute.
         */
-       if ( rs->sr_flags & REP_ENTRY_MODIFIABLE )
-               me = e;
-       else
-               me = entry_dup( e );
+       rs_ensure_entry_modifiable( op, rs, (slap_overinst *) op->o_bd->bd_info );
+       me = rs->sr_entry;
                
        for ( ci = (cloak_info_t *)sc->sc_private; ci; ci = ci->ci_next ) {
                Attribute *a;
@@ -251,14 +249,6 @@ cloak_search_cb( Operation *op, SlapReply *rs )
 
        }
 
-       if ( me != e ) {
-               if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED )
-                       entry_free( e );
-
-               rs->sr_entry = me;
-               rs->sr_flags |= REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED;
-       }
-
        return ( SLAP_CB_CONTINUE );
 }