]> git.sur5r.net Git - openldap/commitdiff
ITS#5340,ITS#6423
authorQuanah Gibson-Mount <quanah@openldap.org>
Wed, 14 Apr 2010 19:26:11 +0000 (19:26 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 14 Apr 2010 19:26:11 +0000 (19:26 +0000)
CHANGES
servers/slapd/overlays/collect.c
servers/slapd/overlays/dynlist.c
servers/slapd/overlays/rwm.c
servers/slapd/overlays/valsort.c

diff --git a/CHANGES b/CHANGES
index ceff7d87c27cfd196219465f4d8d851d4540ffca..a3a3aceda2b1b12e90820c6d8a8a397f53bcc0b1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -13,8 +13,12 @@ OpenLDAP 2.4.21 Release (2009/12/20)
        Fixed slapo-dynlist behavior with simple filters (ITS#6421)
        Fixed slapd-ldif access outside database directory (ITS#6414)
        Fixed slapd-null extraneous assert (ITS#6403)
+       Fixed slapo-collect REP_ENTRY flag handling (ITS#5340,ITS#6423)
+       Fixed slapo-dynlist REP_ENTRY flag handling (ITS#5340,ITS#6423)
+       Fixed slapo-rwm REP_ENTRY flag handling (ITS#5340,ITS#6423)
        Fixed slapo-translucent with back-null (ITS#6403)
        Fixed slapo-unique criteria checking (ITS#6270)
+       Fixed slapo-valsort REP_ENTRY flag handling (ITS#5340,ITS#6423)
        Build Environment
                Deleted broken LBER_INVALID macro (ITS#6402)
                Fixed test058 kill usage (ITS#6420)
index 2b60350e0e25ca522a0bfbed657345bc2b9da512..48fec67cb95caf042d219664ddb5718c158ceb3f 100644 (file)
@@ -386,10 +386,18 @@ collect_response( Operation *op, SlapReply *rs )
                        * don't modify it directly. Make a copy and
                        * work with that instead.
                        */
-                       if ( !( rs->sr_flags & REP_ENTRY_MODIFIABLE )) {
-                               rs->sr_entry = entry_dup( rs->sr_entry );
-                               rs->sr_flags |= REP_ENTRY_MODIFIABLE |
-                                       REP_ENTRY_MUSTBEFREED;
+                       if ( !( rs->sr_flags & REP_ENTRY_MODIFIABLE ) ) {
+                               Entry *e;
+
+                               e = entry_dup( rs->sr_entry );
+                               if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
+                                       overlay_entry_release_ov( op, rs->sr_entry, 0, on );
+                                       rs->sr_flags &= ~REP_ENTRY_MUSTRELEASE;
+                               } else if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
+                                       entry_free( rs->sr_entry );
+                               }
+                               rs->sr_entry = e;
+                               rs->sr_flags |= REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED;
                        }
 
                        /* Loop for each attribute in this collectinfo */
index 12769b9576a7c6cd48b37f756ceba5fda417d669..706ff597604fc1bc5e7caf29827d1ad7492dcebe 100644 (file)
@@ -465,6 +465,7 @@ dynlist_prepare_entry( Operation *op, SlapReply *rs, dynlist_info_t *dli )
        if ( !( rs->sr_flags & REP_ENTRY_MODIFIABLE ) ) {
                e = entry_dup( rs->sr_entry );
                e_flags |= ( REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED );
+               e_flags &= ~REP_ENTRY_MUSTRELEASE;
        } else {
                e = rs->sr_entry;
        }
index 08e23ee2b070767cab97d156d1d9b86046463d8d..176ccccff5e1a44f64632913ecc18654c05450fb 100644 (file)
@@ -1505,6 +1505,13 @@ rwm_send_entry( Operation *op, SlapReply *rs )
        (void)rwm_attrs( op, rs, &e->e_attrs, 1 );
 
        if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
+               /* ITS#6423: REP_ENTRY_MUSTRELEASE incompatible
+                * with REP_ENTRY_MODIFIABLE */
+               if ( rs->sr_entry == e ) {
+                       rc = 1;
+                       goto fail;
+               }
+
                overlay_entry_release_ov( op, rs->sr_entry, 0, on );
        }
 
index 97097bd189c2ac90f6133b3160b8bd9c73297c6b..5f5c2e10bc66457eef8a79ea2d3fc669fef767b5 100644 (file)
@@ -297,9 +297,19 @@ valsort_response( Operation *op, SlapReply *rs )
                a = attr_find( rs->sr_entry->e_attrs, vi->vi_ad );
                if ( !a ) continue;
 
-               if (( rs->sr_flags & ( REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED )) !=
-                       ( REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED )) {
-                       rs->sr_entry = entry_dup( rs->sr_entry );
+               if (( rs->sr_flags & ( REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED ) ) !=
+                       ( REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED ) )
+               {
+                       Entry *e;
+
+                       e = entry_dup( rs->sr_entry );
+                       if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
+                               overlay_entry_release_ov( op, rs->sr_entry, 0, on );
+                               rs->sr_flags &= ~REP_ENTRY_MUSTRELEASE;
+                       } else if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
+                               entry_free( rs->sr_entry );
+                       }
+                       rs->sr_entry = e;
                        rs->sr_flags |= REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED;
                        a = attr_find( rs->sr_entry->e_attrs, vi->vi_ad );
                }