]> git.sur5r.net Git - openldap/commitdiff
Append tweak: must init mdb->mi_nextid
authorHoward Chu <hyc@openldap.org>
Sun, 22 Jul 2012 22:44:11 +0000 (15:44 -0700)
committerHoward Chu <hyc@openldap.org>
Sun, 22 Jul 2012 22:44:11 +0000 (15:44 -0700)
Otherwise duplicate entries aren't detected

servers/slapd/back-mdb/tools.c

index 4a53962ecc883f7bbd38abf9c657c00bb3390a99..ec62c50cc35c327d9090cc4cab1a4b3e6ec6d330 100644 (file)
@@ -619,6 +619,10 @@ ID mdb_tool_entry_put(
                                 text->bv_val, 0, 0 );
                        return NOID;
                }
+               if ( !mdb->mi_nextid ) {
+                       ID dummy;
+                       mdb_next_id( be, idcursor, &dummy );
+               }
                rc = mdb_cursor_open( txn, mdb->mi_dn2id, &mcp );
                if( rc != 0 ) {
                        snprintf( text->bv_val, text->bv_len,