Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190114205345.Horde.IcnVhJs0RGJWUQBLwJoyrNv@webmail.michael-kaufmann.ch>
Date: Mon, 14 Jan 2019 20:53:45 +0100
From: Michael Kaufmann <mail@...hael-kaufmann.ch>
To: musl@...ts.openwall.com
Subject: Re: Use local time in syslog() function

>> I have found a bug in the implementation of syslog(). It should use
>> the local time instead of UTC when sending the message to /dev/log.
>> So in src/misc/syslog.c, the call to gmtime_r() should be replaced
>> with localtime_r().
>
> This is not a bug; rather, use of local time there in glibc and other
> systems is a bug. Local time varies by the sending process and
> produces inconsistent and uninterpretable log messages. Moreover the
> syslog() function is not specified to depend on the environment and
> thereby is not allowed to call any function whose behavior is
> dependant on the environment.

Thank you for responding!

I agree that GMT would have been a better choice, but I think local  
time is also mandated by RFC 3164,  
https://tools.ietf.org/html/rfc3164#section-4.1.2 : "The TIMESTAMP  
field is the local time". Or does this RFC not apply for syslog() on  
Linux?

There's also this older discussion:  
https://www.openwall.com/lists/musl/2014/01/28/2 - sorry, I have not  
found it before.

Regards,
Michael

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.