andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 5fc975a783e50339890789a75e2cc1a33594aae0 Mon Sep 17 00:00:00 2001
dc8c34
From: Ludwig Krispenz <lkrispen@redhat.com>
dc8c34
Date: Fri, 9 Jan 2015 13:28:05 +0100
dc8c34
Subject: [PATCH 376/378] Ticket 47964 - 1.2.11 - Incorrect search result after
dc8c34
 replacing an empty attribute
dc8c34
dc8c34
Bug Description:  when a replace operation for a nonexisting attribute is
dc8c34
                  done without providing new values the entry is stored
dc8c34
                  with incorrect meta data: an empty deleted value without
dc8c34
                  attribute deletion csn.
dc8c34
dc8c34
Fix Description:   in the delete phase of the replace operation already create
dc8c34
                   the attribute to set the deletion csn. It would be created anyway
dc8c34
                   in the add part of the replace operation.
dc8c34
                   The function to calculate the required size to write the entry
dc8c34
                   needs also to be adjusted.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/47964
dc8c34
dc8c34
Reviewed by: Rich, thanks
dc8c34
dc8c34
Note for 389-ds-base-1.2.11: applying the patch just to entry2str_internal_size_attrlist (entry.c).
dc8c34
dc8c34
(cherry picked from commit 3182d2e8524c319393ab37ffcf6a8aefb9b92b54)
dc8c34
(cherry picked from commit d1cf785b82235c2468002274f020efc1d8f3fcc3)
dc8c34
---
dc8c34
 ldap/servers/slapd/entry.c | 2 ++
dc8c34
 1 file changed, 2 insertions(+)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
dc8c34
index 340844d..f3d9c86 100644
dc8c34
--- a/ldap/servers/slapd/entry.c
dc8c34
+++ b/ldap/servers/slapd/entry.c
dc8c34
@@ -1487,6 +1487,8 @@ entry2str_internal_size_attrlist( const Slapi_Attr *attrlist, int entry2str_ctrl
dc8c34
 				 * We need to add the size for that.
dc8c34
 				 */
dc8c34
 				elen += 1 + LDIF_CSNPREFIX_MAXLENGTH + CSN_STRSIZE;
dc8c34
+                                /* need also space for ";deletedattribute;deleted" */
dc8c34
+                                elen += DELETED_ATTR_STRSIZE + DELETED_VALUE_STRSIZE;
dc8c34
 			}
dc8c34
 		}
dc8c34
 	}
dc8c34
-- 
dc8c34
2.4.3
dc8c34