andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 4be358d73e57edcedb26de423f7ed3032bc1ca61 Mon Sep 17 00:00:00 2001
dc8c34
From: German Parente <gparente@redhat.com>
dc8c34
Date: Wed, 8 Oct 2014 14:55:47 +0200
dc8c34
Subject: [PATCH 265/267] Description: Fix for ticket 47915: replication
dc8c34
 inconsistency for add/replace/delete single valued attribute
dc8c34
 https://fedorahosted.org/389/ticket/47915 Resolves: Ticket 47915 Bug
dc8c34
 Description:   In MMR, when deleting a single valued attribute specifying its
dc8c34
 value,   the operation is not replicated and the entry state does not reflect
dc8c34
   the attribute deletion. Reviewed by: Rich and Ludwig (Thanks a lot!)
dc8c34
 Branch: 1.2.11.15 Fix Description:    The fix consists on using the diffs
dc8c34
 already present in master branch to:    - replicate the delete operation    -
dc8c34
 generate the entry state indicating attribute has been deleted Platforms
dc8c34
 tested:    rhel6.5 Flag Day: no Doc impact: no
dc8c34
dc8c34
(cherry picked from commit db60b2709772320fef9c365b1992a209935131f4)
dc8c34
---
dc8c34
 ldap/servers/slapd/entry.c    | 3 +++
dc8c34
 ldap/servers/slapd/entrywsi.c | 2 +-
dc8c34
 2 files changed, 4 insertions(+), 1 deletion(-)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
dc8c34
index 8b7766e..1341296 100644
dc8c34
--- a/ldap/servers/slapd/entry.c
dc8c34
+++ b/ldap/servers/slapd/entry.c
dc8c34
@@ -1638,6 +1638,9 @@ entry2str_internal_put_attrlist( const Slapi_Attr *attrlist, int attr_state, int
dc8c34
 				else
dc8c34
 				{
dc8c34
 					/* There were no present values on which to place the ADCSN, so we put it on the first deleted value. */
dc8c34
+                                        if ( valueset_isempty(&a->a_deleted_values)) {
dc8c34
+                                             valueset_add_string (a,(Slapi_ValueSet *)&a->a_deleted_values, "", CSN_TYPE_VALUE_DELETED, a->a_deletioncsn);
dc8c34
+                                        }
dc8c34
 					entry2str_internal_put_valueset(a->a_type, a->a_deletioncsn, CSN_TYPE_ATTRIBUTE_DELETED, attr_state, &a->a_deleted_values, VALUE_DELETED, ecur, typebuf, typebuf_len, entry2str_ctrl);
dc8c34
 				}
dc8c34
 			}
dc8c34
diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c
dc8c34
index 40fe39b..663d115 100644
dc8c34
--- a/ldap/servers/slapd/entrywsi.c
dc8c34
+++ b/ldap/servers/slapd/entrywsi.c
dc8c34
@@ -581,7 +581,7 @@ entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval
dc8c34
 				   there are present values with a later CSN - otherwise, even though
dc8c34
 				   the value will be updated with a VDCSN which is later than the VUCSN,
dc8c34
 				   the attribute will not be deleted */
dc8c34
-				if(slapi_attr_flag_is_set(a,SLAPI_ATTR_FLAG_SINGLE) && valueset_isempty(&a->a_present_values))
dc8c34
+				if(slapi_attr_flag_is_set(a,SLAPI_ATTR_FLAG_SINGLE) && valuesupdated && *valuesupdated)
dc8c34
 				{
dc8c34
 					attr_set_deletion_csn(a,csn);			
dc8c34
 				}
dc8c34
-- 
dc8c34
1.9.3
dc8c34