ldap/servers/plugins/replication/cl5_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit f944cd093d05d4bd0784b0c46b91335b6bcebcf2
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Wed Sep 11 11:08:58 2013 +0200
Ticket 47489 - Under specific values of nsDS5ReplicaName, replication may get broken or updates missing
Bug Description:
If the 'nsDS5ReplicaName' (of a replica), contains the database suffix (e.g. 'db', 'db3' or 'db4).
Then replication plugin fails to open the changelog. It could conduct to changelog being recreated or some
last updates to be corrupted.
A consequence that I can reproduce, is that some updates may be removed from the changelog and missing
updates on consumers.
This could conduct to replication break, if for example an entry created is not replicated and then later updated.
Fix Description:
The fix consist to use 'PL_strrstr' rather than 'strstr' to check the database suffix is valid
https://fedorahosted.org/389/ticket/47489
Reviewed by: Rich Megginson (thanks Rich !)
Platforms tested: Fedora 17
Flag Day: no
Doc impact: no
(cherry picked from commit 7a7609d88caf9c0971e694d7eeb78f30aea7fec9)
(cherry picked from commit ac8aad8260d3e5ed403e2d4a9967447a97925ba7)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index f17650d..f2e038e 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -6117,7 +6117,7 @@ static int _cl5FileEndsWith(const char *filename, const char *ext)
{
return 0;
}
- p = strstr(filename, ext);
+ p = PL_strrstr(filename, ext);
if (NULL == p)
{
return 0;
ldap/servers/slapd/util.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit f7156e0a452af85b5e2604722463ab4e22f3ac0e
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Sep 26 14:42:20 2013 -0400
Ticket 47528 - 389-ds-base built with mozldap can crash from invalid free
Bug Description: The issue is that the slapi_escape_filter_value() returned string gets
freed by the caller. When using mozldap, this function can return the
original filter pointer, which can lead to a double free.
Fix Description: Return a copy of the filter str so it can be safely freed. Also free
the buf if it's not being returned.
https://fedorahosted.org/389/ticket/47528
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit da59cff5e6d27c18bbb02cba98bb99c1bfa37c70)
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 653914b..0073df5 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -477,8 +477,14 @@ slapi_escape_filter_value(char* filter_str, int len)
}
#else
char *buf = slapi_ch_calloc(sizeof(char), filter_len*3+1);
+ char *esc_str = do_escape_string(filter_str, filter_len, buf, special_filter);
- return do_escape_string(filter_str, filter_len, buf, special_filter);
+ if(esc_str != buf){
+ slapi_ch_free_string(&buf);
+ return slapi_ch_strdup(esc_str);
+ } else {
+ return buf;
+ }
#endif
}
ldap/servers/slapd/util.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit da59cff5e6d27c18bbb02cba98bb99c1bfa37c70
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Sep 26 14:42:20 2013 -0400
Ticket 47528 - 389-ds-base built with mozldap can crash from invalid free
Bug Description: The issue is that the slapi_escape_filter_value() returned string gets
freed by the caller. When using mozldap, this function can return the
original filter pointer, which can lead to a double free.
Fix Description: Return a copy of the filter str so it can be safely freed. Also free
the buf if it's not being returned.
https://fedorahosted.org/389/ticket/47528
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 1991040..9dd3822 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -477,8 +477,14 @@ slapi_escape_filter_value(char* filter_str, int len)
}
#else
char *buf = slapi_ch_calloc(sizeof(char), filter_len*3+1);
+ char *esc_str = do_escape_string(filter_str, filter_len, buf, special_filter);
- return do_escape_string(filter_str, filter_len, buf, special_filter);
+ if(esc_str != buf){
+ slapi_ch_free_string(&buf);
+ return slapi_ch_strdup(esc_str);
+ } else {
+ return buf;
+ }
#endif
}
ldap/servers/slapd/back-ldbm/index.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
New commits:
commit 058d01d7479204a2507dab822cd81e32c37be862
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Sep 25 08:51:12 2013 -0600
Ticket #47504 idlistscanlimit per index/type/value
https://fedorahosted.org/389/ticket/47504
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: This patch broke replication. The problem is that we cannot
compare the allidslimit to 0 unless the value is explicitly set by
index_get_allids. The fix is to only return ALLIDS if the allidslimit was
explicitly set to 0 by index_get_allids.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c
index 50c03c0..c141800 100644
--- a/ldap/servers/slapd/back-ldbm/index.c
+++ b/ldap/servers/slapd/back-ldbm/index.c
@@ -52,7 +52,7 @@
static const char *errmsg = "database index operation failed";
static int is_indexed (const char* indextype, int indexmask, char** index_rules);
-static int index_get_allids( int default_allids, const char *indextype, struct attrinfo *ai, const struct berval *val, unsigned int flags );
+static int index_get_allids( int *allids, const char *indextype, struct attrinfo *ai, const struct berval *val, unsigned int flags );
static Slapi_Value **
valuearray_minus_valuearray(
@@ -991,8 +991,11 @@ index_read_ext_allids(
slapi_pblock_get(pb, SLAPI_SEARCH_IS_AND, &is_and);
}
ai_flags = is_and ? INDEX_ALLIDS_FLAG_AND : 0;
- allidslimit = index_get_allids( allidslimit, indextype, ai, val, ai_flags );
- if (allidslimit == 0) {
+ /* the caller can pass in a value of 0 - just ignore those - but if the index
+ * config sets the allidslimit to 0, this means to skip the index
+ */
+ if (index_get_allids( &allidslimit, indextype, ai, val, ai_flags ) &&
+ (allidslimit == 0)) {
idl = idl_allids( be );
if (unindexed != NULL) *unindexed = 1;
LDAPDebug1Arg( LDAP_DEBUG_BACKLDBM, "<= index_read %lu candidates "
@@ -2406,9 +2409,9 @@ valuearray_minus_valuearray(
#define AI_HAS_TYPE 0x02
#define AI_HAS_FLAG 0x01
static int
-index_get_allids( int default_allids, const char *indextype, struct attrinfo *ai, const struct berval *val, unsigned int flags )
+index_get_allids( int *allids, const char *indextype, struct attrinfo *ai, const struct berval *val, unsigned int flags )
{
- int allids = default_allids;
+ int found = 0;
Slapi_Value sval;
struct index_idlistsizeinfo *iter; /* iterator */
int cookie = 0;
@@ -2416,7 +2419,7 @@ index_get_allids( int default_allids, const char *indextype, struct attrinfo *ai
struct index_idlistsizeinfo *best_match = NULL;
if (!ai->ai_idlistinfo) {
- return allids;
+ return found;
}
if (val) { /* val should already be a Slapi_Value, but some paths do not use Slapi_Value */
@@ -2460,9 +2463,10 @@ index_get_allids( int default_allids, const char *indextype, struct attrinfo *ai
}
if (best_match) {
- allids = best_match->ai_idlistsizelimit;
+ *allids = best_match->ai_idlistsizelimit;
+ found = 1; /* found a match */
}
- return allids;
+ return found;
}