mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
ITS#3267 fix out-of-order slapadd
This commit is contained in:
parent
02464d6e34
commit
546bc9cf19
@ -215,7 +215,7 @@ static int bdb_tool_next_id(
|
|||||||
struct berval dn = e->e_name;
|
struct berval dn = e->e_name;
|
||||||
struct berval ndn = e->e_nname;
|
struct berval ndn = e->e_nname;
|
||||||
struct berval pdn, npdn;
|
struct berval pdn, npdn;
|
||||||
EntryInfo *ei = NULL;
|
EntryInfo *ei = NULL, eidummy;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (ndn.bv_len == 0) return 0;
|
if (ndn.bv_len == 0) return 0;
|
||||||
@ -224,6 +224,7 @@ static int bdb_tool_next_id(
|
|||||||
if ( ei ) bdb_cache_entryinfo_unlock( ei );
|
if ( ei ) bdb_cache_entryinfo_unlock( ei );
|
||||||
if ( rc == DB_NOTFOUND ) {
|
if ( rc == DB_NOTFOUND ) {
|
||||||
if ( !be_issuffix( op->o_bd, &ndn ) ) {
|
if ( !be_issuffix( op->o_bd, &ndn ) ) {
|
||||||
|
ID eid = e->e_id;
|
||||||
dnParent( &dn, &pdn );
|
dnParent( &dn, &pdn );
|
||||||
dnParent( &ndn, &npdn );
|
dnParent( &ndn, &npdn );
|
||||||
e->e_name = pdn;
|
e->e_name = pdn;
|
||||||
@ -234,6 +235,10 @@ static int bdb_tool_next_id(
|
|||||||
if ( rc ) {
|
if ( rc ) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
if ( eid != e->e_id ) {
|
||||||
|
eidummy.bei_id = e->e_id;
|
||||||
|
ei = &eidummy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rc = bdb_next_id( op->o_bd, tid, &e->e_id );
|
rc = bdb_next_id( op->o_bd, tid, &e->e_id );
|
||||||
if ( rc ) {
|
if ( rc ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user