Blame SOURCES/0003-Ticket-48212-Dynamic-nsMatchingRule-changes-had-no-e.patch

a2f18f
From 2ad324a00c8e429171d5c096a56c32aed3206466 Mon Sep 17 00:00:00 2001
a2f18f
From: Noriko Hosoi <nhosoi@redhat.com>
a2f18f
Date: Wed, 1 Jul 2015 18:16:20 -0700
a2f18f
Subject: [PATCH 3/7] Ticket #48212 - Dynamic nsMatchingRule changes had no
a2f18f
 effect on the attrinfo thus following reindexing, as well.
a2f18f
a2f18f
Description: When nsMatchingRule was dynamically updated in an index entry,
a2f18f
the value was set to the configuration but was not applied to the attribute
a2f18f
info.  On-line reindexing following the nsMatchingRule change actually ignored
a2f18f
the setting. On the other hand, the standalone utility dbverify independently
a2f18f
picked up the nsMatchingRule from the configuration and generated the attribute
a2f18f
info, which expected the index reindexed based upon the new nsMatchingRule. But
a2f18f
it was actually not and dbverify reported the index corruption.
a2f18f
a2f18f
This patch applies the changes to the attribute info when nsMatchingRule is
a2f18f
modified.
a2f18f
a2f18f
https://fedorahosted.org/389/ticket/48212
a2f18f
a2f18f
Reviewed by rmeggins@redhat.com (Thank you, Rich!)
a2f18f
a2f18f
(cherry picked from commit d9679725e69df1d191864ca00bad6b79b13e7362)
a2f18f
(cherry picked from commit d15beff66fd28902bd8ca80af12ad76a7ecbe57d)
a2f18f
---
a2f18f
 ldap/servers/slapd/back-ldbm/ldbm_attr.c | 11 ++++++++++-
a2f18f
 1 file changed, 10 insertions(+), 1 deletion(-)
a2f18f
a2f18f
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
a2f18f
index 62ed6e1..092b6b5 100644
a2f18f
--- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c
a2f18f
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
a2f18f
@@ -127,7 +127,16 @@ ainfo_dup(
a2f18f
   attrinfo_delete_idlistinfo(&a->ai_idlistinfo);
a2f18f
   a->ai_idlistinfo = b->ai_idlistinfo;
a2f18f
   b->ai_idlistinfo = NULL;
a2f18f
-  
a2f18f
+
a2f18f
+  /* copy cmp functions and substr lengths */
a2f18f
+  a->ai_key_cmp_fn = b->ai_key_cmp_fn;
a2f18f
+  a->ai_dup_cmp_fn = b->ai_dup_cmp_fn;
a2f18f
+  if (b->ai_substr_lens) {
a2f18f
+    size_t substrlen = sizeof(int) * INDEX_SUBSTRLEN;
a2f18f
+    a->ai_substr_lens = (int *)slapi_ch_calloc(1, substrlen);
a2f18f
+    memcpy(a->ai_substr_lens, b->ai_substr_lens, substrlen);
a2f18f
+  }
a2f18f
+
a2f18f
   return( 1 );
a2f18f
 }
a2f18f
 
a2f18f
-- 
a2f18f
1.9.3
a2f18f