From: Howard Chu Date: Mon, 9 Apr 2012 12:18:44 +0000 (-0700) Subject: MDB_APPEND should only be used in tool mode X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=71843da2a7493148e594f9d8baac2838f63be37a;p=openldap MDB_APPEND should only be used in tool mode --- diff --git a/servers/slapd/back-mdb/dn2id.c b/servers/slapd/back-mdb/dn2id.c index 175c4b44d1..a1ad917b8f 100644 --- a/servers/slapd/back-mdb/dn2id.c +++ b/servers/slapd/back-mdb/dn2id.c @@ -190,11 +190,14 @@ mdb_dn2id_add( rc = mdb_cursor_put( mcp, &key, &data, MDB_NODUPDATA ); if (rc == 0) { + int flag = MDB_NODUPDATA; nid = e->e_id; memcpy( ptr, &pid, sizeof( ID )); d->nrdnlen[0] ^= 0x80; - rc = mdb_cursor_put( mcd, &key, &data, MDB_NODUPDATA|MDB_APPEND ); + if (slapMode & SLAP_TOOL_MODE) + flag |= MDB_APPEND; + rc = mdb_cursor_put( mcd, &key, &data, flag ); } fail: