From 546bc9cf19ae9239f24886ed123fac573c6895ce Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 9 Apr 2005 00:38:18 +0000 Subject: [PATCH] ITS#3267 fix out-of-order slapadd --- servers/slapd/back-bdb/tools.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index a702106f35..65471722e4 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -215,7 +215,7 @@ static int bdb_tool_next_id( struct berval dn = e->e_name; struct berval ndn = e->e_nname; struct berval pdn, npdn; - EntryInfo *ei = NULL; + EntryInfo *ei = NULL, eidummy; int rc; if (ndn.bv_len == 0) return 0; @@ -224,6 +224,7 @@ static int bdb_tool_next_id( if ( ei ) bdb_cache_entryinfo_unlock( ei ); if ( rc == DB_NOTFOUND ) { if ( !be_issuffix( op->o_bd, &ndn ) ) { + ID eid = e->e_id; dnParent( &dn, &pdn ); dnParent( &ndn, &npdn ); e->e_name = pdn; @@ -234,6 +235,10 @@ static int bdb_tool_next_id( if ( rc ) { return rc; } + if ( eid != e->e_id ) { + eidummy.bei_id = e->e_id; + ei = &eidummy; + } } rc = bdb_next_id( op->o_bd, tid, &e->e_id ); if ( rc ) { -- 2.39.5