http://bugzilla.spamassassin.org/show_bug.cgi?id=4374





------- Additional Comments From [EMAIL PROTECTED]  2005-06-03 07:05 -------
OS is Linux - redhat 7.3 system (running kernel 2.4.29)

spamd options are: -c -d -r /var/run/spamd.pid -s /var/log/spamd
--socketpath=/tmp/spamd.sock

/etc/sysconfig/clock contains:

ZONE="Canada/Eastern"
UTC=false
ARC=false

/etc/localtime is a link to /usr/share/zoneinfo/Canada/Eastern

root runs spamd and then setuids to each user.

The fact that all other daemons are providing the right time in the logs, I
don't think the issue is timezone related unless spamassassin is referring to
some variable that is not set?

I don't really know perl, but here's my shot at the error...

The function logmsg_file is as follows:
sub logmsg_file {
  my $msg = shift;
  my @date = reverse( ( gmtime(time) )[ 0 .. 5 ] );
  $date[0] += 1900;
  $date[1] += 1;
  syswrite(
    STDLOG,
    sprintf(
      "%04d-%02d-%02d %02d:%02d:%02d [%s] %s: %s\n",
      @date, $$, 'i', $msg
    )
  );
}

why is this using gmtime and not localtime?

I ran this from the command prompt:

% perl
my @date = reverse( ( gmtime(time) )[ 0 .. 5 ] );
 $date[0] += 1900;
$date[1] += 1;
printf(
"%04d-%02d-%02d %02d:%02d:%02d",@date);

which generated the wrong time...

I changed to using localtime:
 % perl
my @date = reverse( ( localtime(time) )[ 0 .. 5 ] );
$date[0] += 1900;
$date[1] += 1;
printf(
"%04d-%02d-%02d %02d:%02d:%02d",@date);

The time is right.

Is the solution that simple? I guess so.

Thanks..




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to