]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/collect.c
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / servers / slapd / overlays / collect.c
index 90867fdc8b94d8622f4696d81170369f29e3aa54..697fc987768948c327f2e1262fe2de5c230d7f41 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2009 The OpenLDAP Foundation.
+ * Copyright 2003-2012 The OpenLDAP Foundation.
  * Portions Copyright 2003 Howard Chu.
  * All rights reserved.
  *
@@ -386,19 +386,7 @@ 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 ) ) {
-                               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;
-                       }
+                       rs_entry2modifiable( op, rs, on );
 
                        /* Loop for each attribute in this collectinfo */
                        for(idx=0; idx<ci->ci_ad_num; idx++) {