瀏覽代碼

Ticket 47323 - resurrected entry is not correctly indexed

Bug Description:  If a tombstone entry is resurrected to a glue entry
                  the indexes are not updated correctly.  The objectclass
                  index still shows the resurrected ID in the nsTombstone key.

Fix Description:  Add the correct EQUALITY flag to the index delete function.
                  Otherwise the delete operation is skipped in
                  index_addordel_values_ext_sv().

https://fedorahosted.org/389/ticket/47323

Reviewed by: richm(Thanks!!)
Mark Reynolds 12 年之前
父節點
當前提交
95d07e1f47
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 3 3
      ldap/servers/slapd/back-ldbm/ldbm_add.c
  2. 3 3
      ldap/servers/slapd/back-ldbm/ldbm_delete.c

+ 3 - 3
ldap/servers/slapd/back-ldbm/ldbm_add.c

@@ -817,7 +817,7 @@ ldbm_back_add( Slapi_PBlock *pb )
 		}
 		if(is_resurect_operation)
 		{
-			retval = index_addordel_string(be,SLAPI_ATTR_OBJECTCLASS,SLAPI_ATTR_VALUE_TOMBSTONE,addingentry->ep_id,BE_INDEX_DEL,&txn);
+			retval = index_addordel_string(be,SLAPI_ATTR_OBJECTCLASS,SLAPI_ATTR_VALUE_TOMBSTONE,addingentry->ep_id,BE_INDEX_DEL|BE_INDEX_EQUALITY,&txn);
 			if (DB_LOCK_DEADLOCK == retval) {
 				LDAPDebug( LDAP_DEBUG_ARGS, "add 2 DB_LOCK_DEADLOCK\n", 0, 0, 0 );
 				/* Retry txn */
@@ -834,7 +834,7 @@ ldbm_back_add( Slapi_PBlock *pb )
 				}
 				goto error_return; 
 			}
-			retval = index_addordel_string(be,SLAPI_ATTR_UNIQUEID,slapi_entry_get_uniqueid(addingentry->ep_entry),addingentry->ep_id,BE_INDEX_DEL,&txn);
+			retval = index_addordel_string(be,SLAPI_ATTR_UNIQUEID,slapi_entry_get_uniqueid(addingentry->ep_entry),addingentry->ep_id,BE_INDEX_DEL|BE_INDEX_EQUALITY,&txn);
 			if (DB_LOCK_DEADLOCK == retval) {
 				LDAPDebug( LDAP_DEBUG_ARGS, "add 3 DB_LOCK_DEADLOCK\n", 0, 0, 0 );
 				/* Retry txn */
@@ -855,7 +855,7 @@ ldbm_back_add( Slapi_PBlock *pb )
 			                               SLAPI_ATTR_NSCP_ENTRYDN,
 			                               slapi_sdn_get_ndn(sdn),
 			                               addingentry->ep_id,
-			                               BE_INDEX_DEL, &txn);
+			                               BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn);
 			if (DB_LOCK_DEADLOCK == retval) {
 				LDAPDebug( LDAP_DEBUG_ARGS, "add 4 DB_LOCK_DEADLOCK\n", 0, 0, 0 );
 				/* Retry txn */

+ 3 - 3
ldap/servers/slapd/back-ldbm/ldbm_delete.c

@@ -889,7 +889,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
 
 			retval = index_addordel_string(be, SLAPI_ATTR_OBJECTCLASS,
 							SLAPI_ATTR_VALUE_TOMBSTONE, e->ep_id,
-							BE_INDEX_DEL, &txn);
+							BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn);
 			if (DB_LOCK_DEADLOCK == retval) {
 				LDAPDebug( LDAP_DEBUG_ARGS,
 							"delete (deleting %s) DB_LOCK_DEADLOCK\n",
@@ -909,7 +909,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
 			}
 			retval = index_addordel_string(be, SLAPI_ATTR_UNIQUEID,
 							slapi_entry_get_uniqueid(e->ep_entry),
-							e->ep_id, BE_INDEX_DEL, &txn);
+							e->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn);
 			if (DB_LOCK_DEADLOCK == retval) {
 				LDAPDebug( LDAP_DEBUG_ARGS,
 							"delete (deleting %s) DB_LOCK_DEADLOCK\n",
@@ -932,7 +932,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
 												SLAPI_ATTR_NSCP_ENTRYDN);
 			if (nscpedn) {
 				retval = index_addordel_string(be, SLAPI_ATTR_NSCP_ENTRYDN,
-								nscpedn, e->ep_id, BE_INDEX_DEL, &txn);
+								nscpedn, e->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn);
 				slapi_ch_free((void **)&nscpedn);
 				if (DB_LOCK_DEADLOCK == retval) {
 					LDAPDebug( LDAP_DEBUG_ARGS,