Red Hat Bugzilla – Bug 169578
logconv.pl has an off by one bug in %monthname
Last modified: 2015-12-07 11:58:39 EST
Description of problem:
logconv.pl %month hash is off by one. Month numbers should start with 0,
otherwise the tool will fail when parsing a log where there are days numbered
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run logconv.pl on an access logfile with days which are numbered 31.
Time::Local will fail and say day 31 out of range, use 0..30.
That it would work.
Created attachment 127938 [details]
The timegm() subroutine expects the month to be specified as a range of 0..11.
We were using a range of 1..12 in logconv.pl which would cause timegm() to
report out of range errors when the log was from the month of december or if
the month that we incorrectly mapped to contained less days the day of the
month that the log specified (ex. - If the log has an entry for January 30th,
we'd incorrectly map this to February 30th, which is an invalid date).
This fix changes the range we use for the month to 0..11.
Checked into ldapserver. Reviewed by RIch and Noriko.
Checking in logconv.pl;
/cvs/dirsec/ldapserver/ldap/admin/src/logconv.pl,v <-- logconv.pl
new revision: 1.6; previous revision: 1.5
*** Bug 170039 has been marked as a duplicate of this bug. ***
Some of the entries in the log file I checked aginst:
[31/Oct/2007:10:13:05 -0400] conn=527 op=4 RESULT err=0 tag=101 nentries=5 etime=0
[31/Oct/2007:10:13:05 -0400] conn=527 op=5 SRCH base="cn=replica,cn=\22ou=ou2
with space,o=o1\22,cn=mapping tree,cn=config" scope=2
nsds5BeginReplicaRefresh nsds5replicaUpdateInProgress nsds5replicaLastInitStatus
nsds5replicaLastInitStart nsds5replicaLastInitEnd nsds5replicareapactive
nsDS5ReplicaHost nsDS5ReplicaPort nsDS5ReplicaBindMethod
[31/Oct/2007:10:13:05 -0400] conn=527 op=5 RESULT err=0 tag=101 nentries=5 etime=0
logconf.pl seemed to run aginst the access log just fine.
1191427572 redhat-ds-base-8.0.0-5.el4dsrv Wed Oct 03 2007