]> git.sur5r.net Git - openldap/commitdiff
Really fix ITS#2905
authorHoward Chu <hyc@openldap.org>
Mon, 12 Jan 2004 04:09:52 +0000 (04:09 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 12 Jan 2004 04:09:52 +0000 (04:09 +0000)
servers/slapd/back-bdb/tools.c

index 93231fefbc1cbbfa82602b91415166c41b17daf5..e73f7c70db73b1159c57cd4a5e2e6c4d0c18a675 100644 (file)
@@ -265,9 +265,8 @@ static int bdb_tool_next_id(
        } else if ( !hole ) {
                unsigned i;
 
-               if ( e->e_id == NOID ) {
-                       return DB_KEYEXIST;
-               }
+               e->e_id = ei->bei_id;
+               rc = DB_KEYEXIST;
 
                for ( i=0; i<nholes; i++) {
                        if ( holes[i].id == e->e_id ) {
@@ -276,6 +275,7 @@ static int bdb_tool_next_id(
                                for (j=i;j<nholes;j++) holes[j] = holes[j+1];
                                holes[j].id = 0;
                                nholes--;
+                               rc = 0;
                                break;
                        } else if ( holes[i].id > e->e_id ) {
                                break;