Branch '389-ds-base-1.2.11' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 962de25824635ff66ab0dd95dacdca17a38d147a
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Sat Dec 14 07:38:12 2013 -0500
Ticket 47627 - Fix replication logging
We printed the same CSN for the missing CSN and the supplier min CSN because
we reused the same CSN pointer.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 20cccf58108099cead2412a979e70e4f5972b806)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 55bda39..ae522a3 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5041,6 +5041,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
int i;
CSN **csns = NULL;
CSN *startCSN = NULL;
+ CSN *minCSN = NULL;
char csnStr [CSN_STRSIZE];
int rc = CL5_SUCCESS;
Object *supplierRuvObj = NULL;
@@ -5130,20 +5131,24 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
*/
if ((rc == DB_NOTFOUND) && !ruv_has_csns(file->purgeRUV))
{
+ char mincsnStr[CSN_STRSIZE];
+
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
- startCSN)
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &minCSN, 1 /* ignore cleaned rids */)) &&
+ minCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
- csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(minCSN, PR_FALSE, mincsnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: CSN %s not found and no purging, probably a reinit\n",
agmt_name, csnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: Will try to use supplier min CSN %s to load changelog\n",
- agmt_name, csnStr);
+ agmt_name, mincsnStr);
}
+ startCSN = minCSN;
rc = clcache_load_buffer (clcache, startCSN, DB_SET);
}
else
10 years, 4 months
Branch '389-ds-base-1.3.0' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 78f20eedf693d9504a20fb39e2e618d259e2bc2b
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Sat Dec 14 07:38:12 2013 -0500
Ticket 47627 - Fix replication logging
We printed the same CSN for the missing CSN and the supplier min CSN because
we reused the same CSN pointer.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 20cccf58108099cead2412a979e70e4f5972b806)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index a769fa7..ea0f85d 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5041,6 +5041,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
int i;
CSN **csns = NULL;
CSN *startCSN = NULL;
+ CSN *minCSN = NULL;
char csnStr [CSN_STRSIZE];
int rc = CL5_SUCCESS;
Object *supplierRuvObj = NULL;
@@ -5130,20 +5131,24 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
*/
if ((rc == DB_NOTFOUND) && !ruv_has_csns(file->purgeRUV))
{
+ char mincsnStr[CSN_STRSIZE];
+
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
- startCSN)
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &minCSN, 1 /* ignore cleaned rids */)) &&
+ minCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
- csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(minCSN, PR_FALSE, mincsnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: CSN %s not found and no purging, probably a reinit\n",
agmt_name, csnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: Will try to use supplier min CSN %s to load changelog\n",
- agmt_name, csnStr);
+ agmt_name, mincsnStr);
}
+ startCSN = minCSN;
rc = clcache_load_buffer (clcache, startCSN, DB_SET);
}
else
10 years, 4 months
Branch '389-ds-base-1.3.1' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit ae3daa16783bab18f202a71b81177f4407dccdcd
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Sat Dec 14 07:38:12 2013 -0500
Ticket 47627 - Fix replication logging
We printed the same CSN for the missing CSN and the supplier min CSN because
we reused the same CSN pointer.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 20cccf58108099cead2412a979e70e4f5972b806)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 064a628..abcc39a 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5081,6 +5081,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
int i;
CSN **csns = NULL;
CSN *startCSN = NULL;
+ CSN *minCSN = NULL;
char csnStr [CSN_STRSIZE];
int rc = CL5_SUCCESS;
Object *supplierRuvObj = NULL;
@@ -5170,20 +5171,24 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
*/
if ((rc == DB_NOTFOUND) && !ruv_has_csns(file->purgeRUV))
{
+ char mincsnStr[CSN_STRSIZE];
+
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
- startCSN)
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &minCSN, 1 /* ignore cleaned rids */)) &&
+ minCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
- csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(minCSN, PR_FALSE, mincsnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: CSN %s not found and no purging, probably a reinit\n",
agmt_name, csnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: Will try to use supplier min CSN %s to load changelog\n",
- agmt_name, csnStr);
+ agmt_name, mincsnStr);
}
+ startCSN = minCSN;
rc = clcache_load_buffer (clcache, startCSN, DB_SET);
}
else
10 years, 4 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit e43bb7d9e8454b5cda03f5795c70114956333bd8
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Sat Dec 14 07:38:12 2013 -0500
Ticket 47627 - Fix replication logging
We printed the same CSN for the missing CSN and the supplier min CSN because
we reused the same CSN pointer.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 20cccf58108099cead2412a979e70e4f5972b806)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 4a9d81c..980296e 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5166,6 +5166,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
int i;
CSN **csns = NULL;
CSN *startCSN = NULL;
+ CSN *minCSN = NULL;
char csnStr [CSN_STRSIZE];
int rc = CL5_SUCCESS;
Object *supplierRuvObj = NULL;
@@ -5255,20 +5256,24 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
*/
if ((rc == DB_NOTFOUND) && !ruv_has_csns(file->purgeRUV))
{
+ char mincsnStr[CSN_STRSIZE];
+
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
- startCSN)
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &minCSN, 1 /* ignore cleaned rids */)) &&
+ minCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
- csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(minCSN, PR_FALSE, mincsnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: CSN %s not found and no purging, probably a reinit\n",
agmt_name, csnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: Will try to use supplier min CSN %s to load changelog\n",
- agmt_name, csnStr);
+ agmt_name, mincsnStr);
}
+ startCSN = minCSN;
rc = clcache_load_buffer (clcache, startCSN, DB_SET);
}
else
10 years, 4 months
ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 20cccf58108099cead2412a979e70e4f5972b806
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Sat Dec 14 07:38:12 2013 -0500
Ticket 47627 - Fix replication logging
We printed the same CSN for the missing CSN and the supplier min CSN because
we reused the same CSN pointer.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins(Thanks!)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 4a9d81c..980296e 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5166,6 +5166,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
int i;
CSN **csns = NULL;
CSN *startCSN = NULL;
+ CSN *minCSN = NULL;
char csnStr [CSN_STRSIZE];
int rc = CL5_SUCCESS;
Object *supplierRuvObj = NULL;
@@ -5255,20 +5256,24 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
*/
if ((rc == DB_NOTFOUND) && !ruv_has_csns(file->purgeRUV))
{
+ char mincsnStr[CSN_STRSIZE];
+
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
- startCSN)
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &minCSN, 1 /* ignore cleaned rids */)) &&
+ minCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
- csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(startCSN, PR_FALSE, csnStr);
+ csn_as_string(minCSN, PR_FALSE, mincsnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: CSN %s not found and no purging, probably a reinit\n",
agmt_name, csnStr);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"%s: Will try to use supplier min CSN %s to load changelog\n",
- agmt_name, csnStr);
+ agmt_name, mincsnStr);
}
+ startCSN = minCSN;
rc = clcache_load_buffer (clcache, startCSN, DB_SET);
}
else
10 years, 4 months
Branch '389-ds-base-1.3.1' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/repl5_agmtlist.c | 12 +-----------
ldap/servers/plugins/replication/repl5_replica_config.c | 2 +-
2 files changed, 2 insertions(+), 12 deletions(-)
New commits:
commit c094a9f1a758dabd1164bf979a4ac22bb3720d63
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Dec 16 09:48:12 2013 -0500
Ticket 47620 - Fix logically dead code.
Coverity issues: 12419 & 12420
https://fedorahosted.org/389/ticket/47620
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 080cb44f5eaa794375a8e69b6e1ac09fcae9a961)
diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c
index bd14202..5219c92 100644
--- a/ldap/servers/plugins/replication/repl5_agmtlist.c
+++ b/ldap/servers/plugins/replication/repl5_agmtlist.c
@@ -277,17 +277,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
break;
}
- /* Start replica initialization */
- if (val == NULL)
- {
- PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "No value supplied for attr (%s)", mods[i]->mod_type);
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: %s\n",
- errortext);
- *returncode = LDAP_UNWILLING_TO_PERFORM;
- rc = SLAPI_DSE_CALLBACK_ERROR;
- break;
- }
-
+ /* Start replica initialization */
if (strcasecmp (val, "start") == 0)
{
start_initialize = 1;
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index 563ced3..fa324e9 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -495,7 +495,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
*returncode = LDAP_SUCCESS;
}
else if (strcasecmp (config_attr, type_replicaProtocolTimeout) == 0 ){
- if (apply_mods && config_attr_value && config_attr_value[0])
+ if (apply_mods)
{
long ptimeout = 0;
10 years, 4 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/repl5_agmtlist.c | 10 ----------
ldap/servers/plugins/replication/repl5_replica_config.c | 2 +-
2 files changed, 1 insertion(+), 11 deletions(-)
New commits:
commit 862f0d6765ba03068d558cdc1e8eb66d1678ea80
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Dec 16 09:48:12 2013 -0500
Ticket 47620 - Fix logically dead code.
Coverity issues: 12419 & 12420
https://fedorahosted.org/389/ticket/47620
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 080cb44f5eaa794375a8e69b6e1ac09fcae9a961)
diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c
index 6b33607..18540b4 100644
--- a/ldap/servers/plugins/replication/repl5_agmtlist.c
+++ b/ldap/servers/plugins/replication/repl5_agmtlist.c
@@ -278,16 +278,6 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
}
/* Start replica initialization */
- if (val == NULL)
- {
- PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "No value supplied for attr (%s)", mods[i]->mod_type);
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: %s\n",
- errortext);
- *returncode = LDAP_UNWILLING_TO_PERFORM;
- rc = SLAPI_DSE_CALLBACK_ERROR;
- break;
- }
-
if (strcasecmp (val, "start") == 0)
{
start_initialize = 1;
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index 7ba6eaa..4e24c7b 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -496,7 +496,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
*returncode = LDAP_SUCCESS;
}
else if (strcasecmp (config_attr, type_replicaProtocolTimeout) == 0 ){
- if (apply_mods && config_attr_value && config_attr_value[0])
+ if (apply_mods)
{
long ptimeout = 0;
10 years, 4 months
ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/repl5_agmtlist.c | 10 ----------
ldap/servers/plugins/replication/repl5_replica_config.c | 2 +-
2 files changed, 1 insertion(+), 11 deletions(-)
New commits:
commit 080cb44f5eaa794375a8e69b6e1ac09fcae9a961
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Dec 16 09:48:12 2013 -0500
Ticket 47620 - Fix logically dead code.
Coverity issues: 12419 & 12420
https://fedorahosted.org/389/ticket/47620
Reviewed by: rmeggins(Thanks!)
diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c
index 7d1c651..59eb84f 100644
--- a/ldap/servers/plugins/replication/repl5_agmtlist.c
+++ b/ldap/servers/plugins/replication/repl5_agmtlist.c
@@ -278,16 +278,6 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
}
/* Start replica initialization */
- if (val == NULL)
- {
- PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "No value supplied for attr (%s)", mods[i]->mod_type);
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: %s\n",
- errortext);
- *returncode = LDAP_UNWILLING_TO_PERFORM;
- rc = SLAPI_DSE_CALLBACK_ERROR;
- break;
- }
-
if (strcasecmp (val, "start") == 0)
{
start_initialize = 1;
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index 9abbbac..dfe898a 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -496,7 +496,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
*returncode = LDAP_SUCCESS;
}
else if (strcasecmp (config_attr, type_replicaProtocolTimeout) == 0 ){
- if (apply_mods && config_attr_value && config_attr_value[0])
+ if (apply_mods)
{
long ptimeout = 0;
10 years, 4 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/filterindex.c | 22 ++++++++++++----------
ldap/servers/slapd/back-ldbm/idl_common.c | 17 ++++++++++++++++-
2 files changed, 28 insertions(+), 11 deletions(-)
New commits:
commit c8b44e12f808c63db1530eeeb2bb1cbd686bd5cb
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Dec 13 10:35:08 2013 -0800
Ticket #47313 - Indexed search with filter containing '&' and "!" with attribute subtypes gives wrong result
Description: commit fae006821bd6e524c0f7f8d5f023f4fe5e160ef0 introduced
a bug, which occurs when a filter includes NOT and one of the results
from the subfilters returns NONE. This patch backoffs the last section
of the commit fae006821bd6e524c0f7f8d5f023f4fe5e160ef0 with an improvement
-- avoiding unnecessary idl duplication.
Also, adding (NULL == idl) checks to idl_common.c.
https://fedorahosted.org/389/ticket/47313
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!)
(cherry picked from commit a71633d56951dd6c4d0368c790b85628f1598968)
diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c
index 971e10b..9ad2ab4 100644
--- a/ldap/servers/slapd/back-ldbm/filterindex.c
+++ b/ldap/servers/slapd/back-ldbm/filterindex.c
@@ -852,17 +852,19 @@ list_candidates(
break; /* We can exit the loop now, since the candidate list is small already */
}
} else if ( ftype == LDAP_FILTER_AND ) {
- if (isnot && !idl_is_allids(tmp)) {
- IDList *new_idl = NULL;
- int notin_result = 0;
- /*
- * If the given tmp is ALLIDs (due to subtype in filter),
- * we cannot use idl_notin.
+ if (isnot) {
+ /*
+ * If tmp is NULL or ALLID, idl_notin just duplicates idl.
+ * We don't have to do it.
*/
- notin_result = idl_notin( be, idl, tmp, &new_idl );
- if (notin_result) {
- idl_free(idl);
- idl = new_idl;
+ if (!tmp && !idl_is_allids(tmp)) {
+ IDList *new_idl = NULL;
+ int notin_result = 0;
+ notin_result = idl_notin( be, idl, tmp, &new_idl );
+ if (notin_result) {
+ idl_free(idl);
+ idl = new_idl;
+ }
}
} else {
idl = idl_intersection(be, idl, tmp);
diff --git a/ldap/servers/slapd/back-ldbm/idl_common.c b/ldap/servers/slapd/back-ldbm/idl_common.c
index 584bba5..e3023d8 100644
--- a/ldap/servers/slapd/back-ldbm/idl_common.c
+++ b/ldap/servers/slapd/back-ldbm/idl_common.c
@@ -46,16 +46,25 @@
size_t idl_sizeof(IDList *idl)
{
+ if (NULL == idl) {
+ return 0;
+ }
return (2 + idl->b_nmax) * sizeof(ID);
}
NIDS idl_length(IDList *idl)
{
+ if (NULL == idl) {
+ return 0;
+ }
return (idl->b_nmax == ALLIDSBLOCK) ? UINT_MAX : idl->b_nids;
}
int idl_is_allids(IDList *idl)
{
+ if (NULL == idl) {
+ return 0;
+ }
return (idl->b_nmax == ALLIDSBLOCK);
}
@@ -110,6 +119,9 @@ idl_free( IDList *idl ) /* JCM - pass in ** */
int
idl_append( IDList *idl, ID id)
{
+ if (NULL == idl) {
+ return 2;
+ }
if ( ALLIDS( idl ) || ( (idl->b_nids) && (idl->b_ids[idl->b_nids - 1] == id)) ) {
return( 1 ); /* already there */
}
@@ -321,7 +333,7 @@ idl_notin(
backend *be,
IDList *a,
IDList *b,
- IDList **new_result
+ IDList **new_result
)
{
NIDS ni, ai, bi;
@@ -435,6 +447,9 @@ idl_nextid( IDList *idl, ID id )
{
NIDS i;
+ if (NULL == idl) {
+ return NOID;
+ }
if ( ALLIDS( idl ) ) {
return( ++id < idl->b_nids ? id : NOID );
}
10 years, 4 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/filterindex.c | 22 ++++++++++++----------
ldap/servers/slapd/back-ldbm/idl_common.c | 17 ++++++++++++++++-
2 files changed, 28 insertions(+), 11 deletions(-)
New commits:
commit a71633d56951dd6c4d0368c790b85628f1598968
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Dec 13 10:35:08 2013 -0800
Ticket #47313 - Indexed search with filter containing '&' and "!" with attribute subtypes gives wrong result
Description: commit fae006821bd6e524c0f7f8d5f023f4fe5e160ef0 introduced
a bug, which occurs when a filter includes NOT and one of the results
from the subfilters returns NONE. This patch backoffs the last section
of the commit fae006821bd6e524c0f7f8d5f023f4fe5e160ef0 with an improvement
-- avoiding unnecessary idl duplication.
Also, adding (NULL == idl) checks to idl_common.c.
https://fedorahosted.org/389/ticket/47313
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!)
diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c
index 971e10b..9ad2ab4 100644
--- a/ldap/servers/slapd/back-ldbm/filterindex.c
+++ b/ldap/servers/slapd/back-ldbm/filterindex.c
@@ -852,17 +852,19 @@ list_candidates(
break; /* We can exit the loop now, since the candidate list is small already */
}
} else if ( ftype == LDAP_FILTER_AND ) {
- if (isnot && !idl_is_allids(tmp)) {
- IDList *new_idl = NULL;
- int notin_result = 0;
- /*
- * If the given tmp is ALLIDs (due to subtype in filter),
- * we cannot use idl_notin.
+ if (isnot) {
+ /*
+ * If tmp is NULL or ALLID, idl_notin just duplicates idl.
+ * We don't have to do it.
*/
- notin_result = idl_notin( be, idl, tmp, &new_idl );
- if (notin_result) {
- idl_free(idl);
- idl = new_idl;
+ if (!tmp && !idl_is_allids(tmp)) {
+ IDList *new_idl = NULL;
+ int notin_result = 0;
+ notin_result = idl_notin( be, idl, tmp, &new_idl );
+ if (notin_result) {
+ idl_free(idl);
+ idl = new_idl;
+ }
}
} else {
idl = idl_intersection(be, idl, tmp);
diff --git a/ldap/servers/slapd/back-ldbm/idl_common.c b/ldap/servers/slapd/back-ldbm/idl_common.c
index 584bba5..e3023d8 100644
--- a/ldap/servers/slapd/back-ldbm/idl_common.c
+++ b/ldap/servers/slapd/back-ldbm/idl_common.c
@@ -46,16 +46,25 @@
size_t idl_sizeof(IDList *idl)
{
+ if (NULL == idl) {
+ return 0;
+ }
return (2 + idl->b_nmax) * sizeof(ID);
}
NIDS idl_length(IDList *idl)
{
+ if (NULL == idl) {
+ return 0;
+ }
return (idl->b_nmax == ALLIDSBLOCK) ? UINT_MAX : idl->b_nids;
}
int idl_is_allids(IDList *idl)
{
+ if (NULL == idl) {
+ return 0;
+ }
return (idl->b_nmax == ALLIDSBLOCK);
}
@@ -110,6 +119,9 @@ idl_free( IDList *idl ) /* JCM - pass in ** */
int
idl_append( IDList *idl, ID id)
{
+ if (NULL == idl) {
+ return 2;
+ }
if ( ALLIDS( idl ) || ( (idl->b_nids) && (idl->b_ids[idl->b_nids - 1] == id)) ) {
return( 1 ); /* already there */
}
@@ -321,7 +333,7 @@ idl_notin(
backend *be,
IDList *a,
IDList *b,
- IDList **new_result
+ IDList **new_result
)
{
NIDS ni, ai, bi;
@@ -435,6 +447,9 @@ idl_nextid( IDList *idl, ID id )
{
NIDS i;
+ if (NULL == idl) {
+ return NOID;
+ }
if ( ALLIDS( idl ) ) {
return( ++id < idl->b_nids ? id : NOID );
}
10 years, 4 months