]> git.sur5r.net Git - openldap/commitdiff
ITS#6983 fix duplicate entry in HDB subtree IDL
authorHoward Chu <hyc@openldap.org>
Thu, 25 Aug 2011 21:47:23 +0000 (14:47 -0700)
committerHoward Chu <hyc@openldap.org>
Thu, 25 Aug 2011 21:47:23 +0000 (14:47 -0700)
servers/slapd/back-bdb/dn2id.c
servers/slapd/back-bdb/idl.c
servers/slapd/back-bdb/proto-bdb.h

index afa2164214c55404f5f12bab4de0607a32bef613..9625443c14443deda01423f338e3c6150ca63ec1 100644 (file)
@@ -945,6 +945,7 @@ hdb_dn2idl_internal(
                        cx->rc = bdb_idl_cache_get(cx->bdb, cx->db, &cx->key, ids);
                        if ( cx->rc == LDAP_SUCCESS ) {
                                if ( cx->depth ) {
+                                       bdb_idl_delete( cx->tmp, cx->id );      /* ITS#6983, drop our own ID */
                                        bdb_idl_append( cx->ids, cx->tmp );
                                        cx->need_sort = 1;
                                }
index e9a415a43fd05095311bc029d38ade88aea69266..853a88c3dd723dee3624f06e60e4c5b6f45eb4b3 100644 (file)
@@ -219,7 +219,7 @@ int bdb_idl_insert( ID *ids, ID id )
        return 0;
 }
 
-static int bdb_idl_delete( ID *ids, ID id )
+int bdb_idl_delete( ID *ids, ID id )
 {
        unsigned x;
 
index f0070775d25cd27d3d720e15f2eb446e2a32832a..87b0a85c639daf1109abc3a0816d36d68ce22b87 100644 (file)
@@ -281,6 +281,7 @@ bdb_idl_cache_del_id(
 #define bdb_idl_next                           BDB_SYMBOL(idl_next)
 #define bdb_idl_search                         BDB_SYMBOL(idl_search)
 #define bdb_idl_insert                         BDB_SYMBOL(idl_insert)
+#define bdb_idl_delete                         BDB_SYMBOL(idl_delete)
 #define bdb_idl_intersection           BDB_SYMBOL(idl_intersection)
 #define bdb_idl_union                          BDB_SYMBOL(idl_union)
 #define bdb_idl_sort                           BDB_SYMBOL(idl_sort)
@@ -303,6 +304,7 @@ int bdb_idl_fetch_key(
        int                     get_flag );
 
 int bdb_idl_insert( ID *ids, ID id );
+int bdb_idl_delete( ID *ids, ID id );
 
 int bdb_idl_insert_key(
        BackendDB *be,