]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/valsort.c
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / servers / slapd / overlays / valsort.c
index e516e46269141b19efced616cf4e2be34c16cab7..5d89eb0554c776d55c43969d259caf027671023a 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * 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 );
                }