HylaFAX The world's
most advanced open source fax server
|
|
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
y2k problem in faxcron/recvstats/xferstats
Hello,
I use hylafax 4.0pl2 on Suse Linux 6.1, but the problem
appears to be present in the current CVS as well.
Since 1/1/2000 faxcron reports _all_ faxes ever sent in
the receive stats, transmission stats, and error log report.
The receive/transmit stats are done in scripts called
recvstats and xferstats respectively, I fixed those (patch attached).
The problem is due to calculation of the age based on
YY * 365 + ..., where YY is a 2-digit year representation.
Fix includes YY < 70 check.
The error reports are filtered from faxcron itself, using
awk. I'm not good at awk, and I haven't tracked down the
problem further.
Bye,
Frans van Dorsselaer
frans@bia-bv.demon.nl
--- orig.recvstats Mon Jan 3 00:11:45 2000
+++ recvstats Mon Jan 3 00:12:20 2000
@@ -157,7 +157,10 @@
#
function cvtDateTime(s)
{
- yday = substr(s,7,2)*365 + substr(s,4,2) - 1;
+ yday = substr(s,7,2);
+ if (yday < 70)
+ yday += 100;
+ yday = yday*365 + substr(s,4,2) - 1;
mon = substr(s,0,2) + 0;
for (i = 0; i < mon; i++)
yday += daysInMonth[i];
--- orig.xferstats Mon Jan 3 00:03:55 2000
+++ xferstats Mon Jan 3 00:11:08 2000
@@ -186,7 +186,10 @@
#
function cvtDateTime(s)
{
- yday = substr(s,7,2)*365 + substr(s,4,2) - 1;
+ yday = substr(s,7,2);
+ if (yday < 70)
+ yday += 100;
+ yday = yday*365 + substr(s,4,2) - 1;
mon = substr(s,0,2) + 0;
for (i = 0; i < mon; i++)
yday += daysInMonth[i];