]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/modify.c
slapi_ch_bvdup() should be implemented in terms of ber_dupbv()
[openldap] / servers / slapd / back-sql / modify.c
index 79644cb969b2339883a26129e88d65ee6863a6f5..c6c84b0c02a54568f1c1b2a2ed104e109949f90a 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2005 The OpenLDAP Foundation.
+ * Copyright 1999-2006 The OpenLDAP Foundation.
  * Portions Copyright 1999 Dmitry Kovalev.
  * Portions Copyright 2002 Pierangelo Masarati.
  * All rights reserved.
@@ -65,7 +65,6 @@ backsql_modify( Operation *op, SlapReply *rs )
        bsi.bsi_e = &m;
        rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
                        LDAP_SCOPE_BASE, 
-                       SLAP_NO_LIMIT, SLAP_NO_LIMIT,
                        (time_t)(-1), NULL, dbh, op, rs,
                        slap_anlist_all_attributes,
                        ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
@@ -123,6 +122,8 @@ backsql_modify( Operation *op, SlapReply *rs )
                goto done;
        }
 
+       slap_mods_opattrs( op, &op->orm_modlist, 1 );
+
        oc = backsql_id2oc( bi, bsi.bsi_base_id.eid_oc_id );
        assert( oc != NULL );
 
@@ -190,6 +191,7 @@ done:;
 #endif /* SLAP_ACL_HONOR_DISCLOSE */
 
        send_ldap_result( op, rs );
+       slap_graduate_commit_csn( op );
 
        if ( !BER_BVISNULL( &bsi.bsi_base_id.eid_ndn ) ) {
                (void)backsql_free_entryID( op, &bsi.bsi_base_id, 0 );
@@ -203,6 +205,11 @@ done:;
                op->o_tmpfree( bsi.bsi_attrs, op->o_tmpmemctx );
        }
 
+       if ( rs->sr_ref ) {
+               ber_bvarray_free( rs->sr_ref );
+               rs->sr_ref = NULL;
+       }
+
        Debug( LDAP_DEBUG_TRACE, "<==backsql_modify()\n", 0, 0, 0 );
 
        return rs->sr_err;