ldap/servers/slapd/back-ldbm/ldbm_delete.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
New commits:
commit 6d439887b99da557e8d7bc0c611d9afa909fdce7
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Jul 20 14:22:05 2015 -0400
Ticket 48206 - Crash during retro changelog trimming
Bug Description: If the retro changelog entry is small, its possible that
during the trimming the reto changelog entry is not in the
cache after the trim, but its tries to blindly unlock it
from the cache, which leads to a crash.
FIx Description: After we call the post op plugins and retrieve the entry
from the cache, double check that it was found. If it
is not found, do not unlock it.
https://fedorahosted.org/389/ticket/48206
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 2a8a8c8ced5849dada34ab28d79e87dd3636e413)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 59c1f76..f31d545 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -1257,17 +1257,24 @@ ldbm_back_delete( Slapi_PBlock *pb )
CACHE_RETURN(&inst->inst_cache, &e);
}
}
- if (cache_is_in_cache(&inst->inst_cache, e)) {
- ep_id = e->ep_id; /* Otherwise, e might have been freed. */
- CACHE_REMOVE(&inst->inst_cache, e);
- }
- cache_unlock_entry(&inst->inst_cache, e);
- CACHE_RETURN(&inst->inst_cache, &e);
- /*
- * e is unlocked and no longer in cache.
- * It could be freed at any moment.
+
+ /*
+ * e could have been replaced by cache_find_id(), recheck if it's NULL
+ * before trying to unlock it, etc.
*/
- e = NULL;
+ if (e) {
+ if (cache_is_in_cache(&inst->inst_cache, e)) {
+ ep_id = e->ep_id; /* Otherwise, e might have been freed. */
+ CACHE_REMOVE(&inst->inst_cache, e);
+ }
+ cache_unlock_entry(&inst->inst_cache, e);
+ CACHE_RETURN(&inst->inst_cache, &e);
+ /*
+ * e is unlocked and no longer in cache.
+ * It could be freed at any moment.
+ */
+ e = NULL;
+ }
if (entryrdn_get_switch() && ep_id) { /* subtree-rename: on */
/* since the op was successful, delete the tombstone dn from the dn cache */
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
New commits:
commit 2a8a8c8ced5849dada34ab28d79e87dd3636e413
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Jul 20 14:22:05 2015 -0400
Ticket 48206 - Crash during retro changelog trimming
Bug Description: If the retro changelog entry is small, its possible that
during the trimming the reto changelog entry is not in the
cache after the trim, but its tries to blindly unlock it
from the cache, which leads to a crash.
FIx Description: After we call the post op plugins and retrieve the entry
from the cache, double check that it was found. If it
is not found, do not unlock it.
https://fedorahosted.org/389/ticket/48206
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 59c1f76..f31d545 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -1257,17 +1257,24 @@ ldbm_back_delete( Slapi_PBlock *pb )
CACHE_RETURN(&inst->inst_cache, &e);
}
}
- if (cache_is_in_cache(&inst->inst_cache, e)) {
- ep_id = e->ep_id; /* Otherwise, e might have been freed. */
- CACHE_REMOVE(&inst->inst_cache, e);
- }
- cache_unlock_entry(&inst->inst_cache, e);
- CACHE_RETURN(&inst->inst_cache, &e);
- /*
- * e is unlocked and no longer in cache.
- * It could be freed at any moment.
+
+ /*
+ * e could have been replaced by cache_find_id(), recheck if it's NULL
+ * before trying to unlock it, etc.
*/
- e = NULL;
+ if (e) {
+ if (cache_is_in_cache(&inst->inst_cache, e)) {
+ ep_id = e->ep_id; /* Otherwise, e might have been freed. */
+ CACHE_REMOVE(&inst->inst_cache, e);
+ }
+ cache_unlock_entry(&inst->inst_cache, e);
+ CACHE_RETURN(&inst->inst_cache, &e);
+ /*
+ * e is unlocked and no longer in cache.
+ * It could be freed at any moment.
+ */
+ e = NULL;
+ }
if (entryrdn_get_switch() && ep_id) { /* subtree-rename: on */
/* since the op was successful, delete the tombstone dn from the dn cache */
ldap/admin/src/logconv.pl | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
New commits:
commit 16b95b12d26fb293d68be154c602398798353bb8
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Jul 20 11:18:12 2015 -0400
Ticket 47910 - logconv.pl - check that the end time is greater than the start time
Bug Description: There is no check if the end time is greater than the start time.
This leads to an empty report being generated, when an error
should be returned instead.
Fix Description: If start and end time are used, validate that the end time is
greater than the start time.
Also, improved an error message when the tool options are not
correctly used.
https://fedorahosted.org/389/ticket/47910
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 34ffa6c44734b99c252e7585bb499089ac8e6a67)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index d26e91e..0038a03 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -148,14 +148,13 @@ while($arg_count <= $#ARGV){
}
if($file_count == 0){
- if($reportStatsSecFile or $reportStatsMinFile){
- print "Usage error for option -m or -M, either the output file or access log is missing!\n\n";
- } else {
- print "There are no access logs specified!\n\n";
- }
+ print "There are no access logs specified, or the tool options have not been used correctly!\n";
exit 1;
}
+#
+# Initialize the statistic blocks
+#
if ($reportStatsSecFile) {
$s_stats = new_stats_block($reportStatsSecFile);
$reportStats = "-m";
@@ -357,6 +356,19 @@ my %monthname = (
);
+#
+# Validate start/end times (if specified)
+#
+if ($startTime and $endTime){
+ # Make sure the end time is not earlier than the start time
+ my $testStart = convertTimeToSeconds($startTime);
+ my $testEnd = convertTimeToSeconds($endTime);
+ if ($testStart > $testEnd){
+ print "Start time ($startTime) is greater than end time ($endTime)!\n";
+ exit 1;
+ }
+}
+
my $linesProcessed;
my $lineBlockCount;
my $cursize = 0;
ldap/admin/src/logconv.pl | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
New commits:
commit 34ffa6c44734b99c252e7585bb499089ac8e6a67
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Jul 20 11:18:12 2015 -0400
Ticket 47910 - logconv.pl - check that the end time is greater than the start time
Bug Description: There is no check if the end time is greater than the start time.
This leads to an empty report being generated, when an error
should be returned instead.
Fix Description: If start and end time are used, validate that the end time is
greater than the start time.
Also, improved an error message when the tool options are not
correctly used.
https://fedorahosted.org/389/ticket/47910
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index d26e91e..0038a03 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -148,14 +148,13 @@ while($arg_count <= $#ARGV){
}
if($file_count == 0){
- if($reportStatsSecFile or $reportStatsMinFile){
- print "Usage error for option -m or -M, either the output file or access log is missing!\n\n";
- } else {
- print "There are no access logs specified!\n\n";
- }
+ print "There are no access logs specified, or the tool options have not been used correctly!\n";
exit 1;
}
+#
+# Initialize the statistic blocks
+#
if ($reportStatsSecFile) {
$s_stats = new_stats_block($reportStatsSecFile);
$reportStats = "-m";
@@ -357,6 +356,19 @@ my %monthname = (
);
+#
+# Validate start/end times (if specified)
+#
+if ($startTime and $endTime){
+ # Make sure the end time is not earlier than the start time
+ my $testStart = convertTimeToSeconds($startTime);
+ my $testEnd = convertTimeToSeconds($endTime);
+ if ($testStart > $testEnd){
+ print "Start time ($startTime) is greater than end time ($endTime)!\n";
+ exit 1;
+ }
+}
+
my $linesProcessed;
my $lineBlockCount;
my $cursize = 0;