X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foverlays%2Fvalsort.c;h=5d89eb0554c776d55c43969d259caf027671023a;hb=c6b5abbfd20567116846ebc38f0005c429284c98;hp=9f57ece910b491371abc80c90fce3babd3387193;hpb=c8c384710376c8cf1b5dfa15d91fa92bbd12beab;p=openldap diff --git a/servers/slapd/overlays/valsort.c b/servers/slapd/overlays/valsort.c index 9f57ece910..5d89eb0554 100644 --- a/servers/slapd/overlays/valsort.c +++ b/servers/slapd/overlays/valsort.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2005-2010 The OpenLDAP Foundation. + * Copyright 2005-2012 The OpenLDAP Foundation. * Portions copyright 2005 Symas Corporation. * All rights reserved. * @@ -297,20 +297,7 @@ 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 ) ) - { - 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; + if ( rs_entry2modifiable( op, rs, on )) { a = attr_find( rs->sr_entry->e_attrs, vi->vi_ad ); } @@ -503,6 +490,10 @@ valsort_destroy( slap_overinst *on = (slap_overinst *)be->bd_info; valsort_info *vi = on->on_bi.bi_private, *next; +#ifdef SLAP_CONFIG_DELETE + overlay_unregister_control( be, LDAP_CONTROL_VALSORT ); +#endif /* SLAP_CONFIG_DELETE */ + for (; vi; vi = next) { next = vi->vi_next; ch_free( vi->vi_dn.bv_val );