From 472a2c0f2f21205390ba87c31c498b4419a932ba Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Jul 21 2010 15:58:20 +0000 Subject: 612771 - RHDS 8.1/389 v1.2.5 accepts 2 identical entries with different DN formats https://bugzilla.redhat.com/show_bug.cgi?id=612771 Fix Description: When newly creating an ancestorid index file, instead of opening the index file with DB_TRUNCATE option, delete the file then create it. --- diff --git a/ldap/servers/slapd/back-ldbm/ancestorid.c b/ldap/servers/slapd/back-ldbm/ancestorid.c index 8f64145..59d7722 100644 --- a/ldap/servers/slapd/back-ldbm/ancestorid.c +++ b/ldap/servers/slapd/back-ldbm/ancestorid.c @@ -397,8 +397,7 @@ static int ldbm_ancestorid_new_idl_create_index(backend *be) ai_aid->ai_indexmask |= INDEX_OFFLINE; /* Open the ancestorid index file */ - ret = dblayer_get_index_file(be, ai_aid, &db_aid, - DBOPEN_CREATE|DBOPEN_TRUNCATE); + ret = dblayer_get_index_file(be, ai_aid, &db_aid, DBOPEN_CREATE); if (ret != 0) { ldbm_nasty(sourcefile,13050,ret); goto out; diff --git a/ldap/servers/slapd/back-ldbm/import.c b/ldap/servers/slapd/back-ldbm/import.c index dde03db..656ceea 100644 --- a/ldap/servers/slapd/back-ldbm/import.c +++ b/ldap/servers/slapd/back-ldbm/import.c @@ -1344,6 +1344,12 @@ int import_main_offline(void *arg) } /* And the ancestorid index */ + { + /* Creating ancestorid from the scratch; delete the index file first. */ + struct attrinfo *ai = NULL; + ainfo_get(be, "ancestorid", &ai); + dblayer_erase_index_file(be, ai, 0); + } if ((ret = ldbm_ancestorid_create_index(be)) != 0) { import_log_notice(job, "Failed to create ancestorid index"); goto error;