]> git.sur5r.net Git - openldap/commitdiff
ITS#6821 make sure objectclass is processed before other mods
authorHoward Chu <hyc@openldap.org>
Thu, 3 Feb 2011 00:15:09 +0000 (00:15 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 3 Feb 2011 00:15:09 +0000 (00:15 +0000)
servers/slapd/back-ndb/modify.cpp

index 07e3a107dd1d929e88e6bf71e2f76165294941f6..76b0ce71f668dc278dba5efa0b61a33979db77d4 100644 (file)
@@ -377,6 +377,14 @@ int ndb_modify_internal(
                return rc;
        }
 
+       if ( got_oc ) {
+               rc = ndb_entry_put_info( op->o_bd, NA, 1 );
+               if ( rc ) {
+                       attrs_free( old );
+                       return rc;
+               }
+       }
+
        /* apply modifications to DB */
        modai = (NdbAttrInfo **)op->o_tmpalloc( nmods * sizeof(NdbAttrInfo*), op->o_tmpmemctx );
 
@@ -400,7 +408,8 @@ int ndb_modify_internal(
        }
        ldap_pvt_thread_rdwr_runlock( &ni->ni_ai_rwlock );
 
-       if ( got_oc || indexed ) {
+       /* If got_oc, this was already done above */
+       if ( indexed && !got_oc) {
                rc = ndb_entry_put_info( op->o_bd, NA, 1 );
                if ( rc ) {
                        attrs_free( old );