From: Howard Chu Date: Fri, 25 Nov 2011 08:23:51 +0000 (-0800) Subject: ITS#7090 fix out-of-order slapadd X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2c4d548206916676026a5b57298ae3086500eb66;p=openldap ITS#7090 fix out-of-order slapadd --- diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index d2f1715477..ea9df05f2d 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -35,6 +35,8 @@ static int mdb_entry_encode(Operation *op, Entry *e, MDB_val *data, Ecount *ec); static Entry *mdb_entry_alloc( Operation *op, int nattrs, int nvals ); +#define ADD_FLAGS (MDB_NOOVERWRITE|MDB_APPEND) + static int mdb_id2entry_put( Operation *op, MDB_txn *txn, @@ -72,7 +74,7 @@ again: if (rc) { /* Was there a hole from slapadd? */ if ( (flag & MDB_NOOVERWRITE) && data.mv_size == 0 ) { - flag ^= MDB_NOOVERWRITE; + flag ^= ADD_FLAGS; goto again; } Debug( LDAP_DEBUG_ANY, @@ -97,7 +99,7 @@ int mdb_id2entry_add( MDB_cursor *mc, Entry *e ) { - return mdb_id2entry_put(op, txn, mc, e, MDB_NOOVERWRITE|MDB_APPEND); + return mdb_id2entry_put(op, txn, mc, e, ADD_FLAGS); } int mdb_id2entry_update(