|
|
dc8c34 |
From ff87d5a6326396f44be5b9aaf800fb2c7432d0d4 Mon Sep 17 00:00:00 2001
|
|
|
dc8c34 |
From: Noriko Hosoi <nhosoi@redhat.com>
|
|
|
dc8c34 |
Date: Thu, 13 Mar 2014 13:06:43 -0700
|
|
|
dc8c34 |
Subject: [PATCH 186/225] Ticket #47735 - e_uniqueid fails to set if an entry
|
|
|
dc8c34 |
is a conflict entry
|
|
|
dc8c34 |
|
|
|
dc8c34 |
Description: In commit e2b8468f459647261812f542485f3481d39bd26c,
|
|
|
dc8c34 |
to get the base type length when a state info is stripped from
|
|
|
dc8c34 |
the attribute type, the fix in str2entry_state_information_from_type
|
|
|
dc8c34 |
blindly returned the base type length for the ordinary sub-typed
|
|
|
dc8c34 |
attributes. This patch fixes it so that only when the state info
|
|
|
dc8c34 |
is removed, the length is reset.
|
|
|
dc8c34 |
|
|
|
dc8c34 |
https://fedorahosted.org/389/ticket/47735
|
|
|
dc8c34 |
|
|
|
dc8c34 |
Reviewed by rmeggins@redhat.com (Thank you, Rich!!)
|
|
|
dc8c34 |
(cherry picked from commit a7ac181d60b1f2ecd3640d0b610eba300b7c3cdb)
|
|
|
dc8c34 |
(cherry picked from commit 4ffa8247ab9dcc45137f07511d62ea33c24f76df)
|
|
|
dc8c34 |
(cherry picked from commit 093a146853e6bb44b08c36a1da22735633adbd4a)
|
|
|
dc8c34 |
(cherry picked from commit 2bb0f1b2b9b1c69118d8c8db1c5426eb7d7690ea)
|
|
|
dc8c34 |
---
|
|
|
dc8c34 |
ldap/servers/slapd/entry.c | 16 +++++++++++++---
|
|
|
dc8c34 |
1 file changed, 13 insertions(+), 3 deletions(-)
|
|
|
dc8c34 |
|
|
|
dc8c34 |
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
|
|
|
dc8c34 |
index 97d21a6..04bac0d 100644
|
|
|
dc8c34 |
--- a/ldap/servers/slapd/entry.c
|
|
|
dc8c34 |
+++ b/ldap/servers/slapd/entry.c
|
|
|
dc8c34 |
@@ -94,13 +94,11 @@ str2entry_state_information_from_type(struct berval *atype,
|
|
|
dc8c34 |
int *attr_state)
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
char *p = NULL;
|
|
|
dc8c34 |
+ char *semicolonp = NULL;
|
|
|
dc8c34 |
if ((NULL == atype) || (NULL == atype->bv_val)) {
|
|
|
dc8c34 |
return;
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
p = PL_strchr(atype->bv_val, ';');
|
|
|
dc8c34 |
- if (p) {
|
|
|
dc8c34 |
- atype->bv_len = p - atype->bv_val;
|
|
|
dc8c34 |
- }
|
|
|
dc8c34 |
*value_state= VALUE_PRESENT;
|
|
|
dc8c34 |
*attr_state= ATTRIBUTE_PRESENT;
|
|
|
dc8c34 |
while(p!=NULL)
|
|
|
dc8c34 |
@@ -159,19 +157,31 @@ str2entry_state_information_from_type(struct berval *atype,
|
|
|
dc8c34 |
csn_init_by_csn ( *maxcsn, *attributedeletioncsn );
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
+ if (NULL == semicolonp) {
|
|
|
dc8c34 |
+ semicolonp = p; /* the first semicolon */
|
|
|
dc8c34 |
+ }
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
else if(strncmp(p+1,"deletedattribute", 16)==0)
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
p[0]='\0';
|
|
|
dc8c34 |
*attr_state= ATTRIBUTE_DELETED;
|
|
|
dc8c34 |
+ if (NULL == semicolonp) {
|
|
|
dc8c34 |
+ semicolonp = p; /* the first semicolon */
|
|
|
dc8c34 |
+ }
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
else if(strncmp(p+1,"deleted", 7)==0)
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
p[0]='\0';
|
|
|
dc8c34 |
*value_state= VALUE_DELETED;
|
|
|
dc8c34 |
+ if (NULL == semicolonp) {
|
|
|
dc8c34 |
+ semicolonp = p; /* the first semicolon */
|
|
|
dc8c34 |
+ }
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
p= strchr(p+1, ';');
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
+ if (semicolonp) {
|
|
|
dc8c34 |
+ atype->bv_len = semicolonp - atype->bv_val;
|
|
|
dc8c34 |
+ }
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
|
|
|
dc8c34 |
/* rawdn is not consumed. Caller needs to free it. */
|
|
|
dc8c34 |
--
|
|
|
dc8c34 |
1.8.1.4
|
|
|
dc8c34 |
|