From 1878bbfef7ae76ed18d709d5414e21cbd0961a38 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Apr 23 2013 02:33:40 +0000 Subject: Ticket #47341 - logconv.pl -m time calculation is wrong https://fedorahosted.org/389/ticket/47341 Reviewed by: nkinder (Thanks!) Branch: 389-ds-base-1.3.1 Fix Description: The variable name is $hr, not $hours. The regex for the sign in the timezone should have been (.) not (?). Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no (cherry picked from commit 87f5ef5a97437cc92afe2496cd06e5d2ec71d9ff) --- diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl index 757f799..3b8adc5 100755 --- a/ldap/admin/src/logconv.pl +++ b/ldap/admin/src/logconv.pl @@ -1574,7 +1574,7 @@ sub parseLineNormal { # tz offset change $lastzone=$tzone; - ($sign,$hr,$min) = $tzone =~ m/(?)(\d\d)(\d\d)/; + ($sign,$hr,$min) = $tzone =~ m/(.)(\d\d)(\d\d)/; $tzoff = $hr*3600 + $min*60; $tzoff *= -1 if $sign eq '-'; @@ -1582,7 +1582,7 @@ sub parseLineNormal } ($date, $hr, $min, $sec) = split (':', $time); ($day, $mon, $yr) = split ('/', $date); - $newmin = timegm(0, $min, $hours, $day, $monthname{$mon}, $yr) - $tzoff; + $newmin = timegm(0, $min, $hr, $day, $monthname{$mon}, $yr) - $tzoff; $gmtime = $newmin + $sec; print_stats_block( $s_stats ); reset_stats_block( $s_stats, $gmtime, $time.' '.$tzone );