From 2e8e162c18fb11d505eafc04ebeb7f29aad8c708 Mon Sep 17 00:00:00 2001 From: Ludwig Krispenz Date: Sep 12 2013 10:44:23 +0000 Subject: Fix regression from fix for 568, - when the last value of an attribute was explicitely deleted the attribute was not moved to the deleted attributes on a replication consumer - when a value of a single valued attr is deleted, check if there is no more added value before moving to deleted attrs --- diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c index 500c2a3..3ac158f 100644 --- a/ldap/servers/slapd/entrywsi.c +++ b/ldap/servers/slapd/entrywsi.c @@ -743,7 +743,10 @@ entry_delete_present_values_wsi_single_valued(Slapi_Entry *e, const char *type, { valuearray_free(&deletedvalues); /* The attribute is single valued and the value was successful deleted */ - entry_present_attribute_to_deleted_attribute(e, a); + /* but there could have been an add in the same operation, so double check */ + if (valueset_isempty(&a->a_present_values)) { + entry_present_attribute_to_deleted_attribute(e, a); + } } else if (retVal != LDAP_SUCCESS) { @@ -825,6 +828,8 @@ entry_delete_present_values_wsi_multi_valued(Slapi_Entry *e, const char *type, s valuearray_update_csn(valuestodelete,CSN_TYPE_VALUE_DELETED,csn); valueset_add_valuearray_ext(&a->a_deleted_values, valuestodelete, SLAPI_VALUE_FLAG_PASSIN); + if(valueset_isempty(&a->a_present_values)) + entry_present_attribute_to_deleted_attribute(e, a); /* all the elements in valuestodelete are passed; * should free valuestodelete only (don't call valuearray_free) * [622023] */