From: Quanah Gibson-Mount Date: Wed, 14 Apr 2010 19:26:11 +0000 (+0000) Subject: ITS#5340,ITS#6423 X-Git-Tag: OPENLDAP_REL_ENG_2_4_22~89 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=85e7991decc5a6931c6ca12e4402e15217bad718;p=openldap ITS#5340,ITS#6423 --- diff --git a/CHANGES b/CHANGES index ceff7d87c2..a3a3aceda2 100644 --- 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) diff --git a/servers/slapd/overlays/collect.c b/servers/slapd/overlays/collect.c index 2b60350e0e..48fec67cb9 100644 --- a/servers/slapd/overlays/collect.c +++ b/servers/slapd/overlays/collect.c @@ -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 */ diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 12769b9576..706ff59760 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -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; } diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index 08e23ee2b0..176ccccff5 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -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 ); } diff --git a/servers/slapd/overlays/valsort.c b/servers/slapd/overlays/valsort.c index 97097bd189..5f5c2e10bc 100644 --- a/servers/slapd/overlays/valsort.c +++ b/servers/slapd/overlays/valsort.c @@ -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 ); }