From 14b7b19c0dbfc26a39d72ba45b423dda2a537f43 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 3 Feb 2011 00:15:09 +0000 Subject: [PATCH] ITS#6821 make sure objectclass is processed before other mods --- servers/slapd/back-ndb/modify.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-ndb/modify.cpp b/servers/slapd/back-ndb/modify.cpp index 07e3a107dd..76b0ce71f6 100644 --- a/servers/slapd/back-ndb/modify.cpp +++ b/servers/slapd/back-ndb/modify.cpp @@ -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 ); -- 2.39.5