]> git.sur5r.net Git - openldap/commitdiff
MDB_APPEND should only be used in tool mode
authorHoward Chu <hyc@openldap.org>
Mon, 9 Apr 2012 12:18:44 +0000 (05:18 -0700)
committerHoward Chu <hyc@openldap.org>
Mon, 9 Apr 2012 12:18:44 +0000 (05:18 -0700)
servers/slapd/back-mdb/dn2id.c

index 175c4b44d1138ae1d9fa11a6cf1db0f8a37dbb28..a1ad917b8f1dead67f223fc4429f02908b638566 100644 (file)
@@ -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: