Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140502081033.24bb01c8@vostro>
Date: Fri, 2 May 2014 08:10:33 +0300
From: Timo Teras <timo.teras@....fi>
To: Timo Teras <timo.teras@....fi>
Cc: musl@...ts.openwall.com, josiahw@...il.com
Subject: Re: Re: ctime, timezone?

On Fri, 2 May 2014 08:06:56 +0300
Timo Teras <timo.teras@....fi> wrote:

> On Thu, 1 May 2014 17:18:32 -0500
> Josiah Worcester <josiahw@...il.com> wrote:
> 
> > On Thu, May 1, 2014 at 5:00 PM, John Mudd <johnbmudd@...il.com>
> > wrote:
> > 
> > > Hmm, I'd like to install my app at 4,000 locations around the
> > > country. Can I avoid explicitly setting $TZ?
> > >
> > >
> > With unpatched musl, not really. In the do_tzset function in
> > __tz.c, I think changing the
> > "if (!s || !*s) s = __gmt;" to simply "if (!s || !*s) s =
> > "/etc/localtime";" should do it, though I wouldn't say for sure
> > without testing.
> > If you simply don't want to have to deal with manually setting TZ to
> > match the /etc/localtime definition everywhere, TZ=/etc/localtime
> > should suffice.
> 
> This will not work for setuid programs.
> 
> I patched musl with:
> http://git.alpinelinux.org/cgit/aports/plain/main/musl/2001-default-to-localtime-timezone-if-TZ-is-undefined.patch
> 
> This needs latest musl git head to work.
> 
> And we configured Alpine to setup /etc/zoneinfo/localtime as symlink
> to the proper place.
> 
> With the patch you could also symlink /etc/zoneinfo/localtime
> -> /etc/localtime and then it'd just work.

Or ship /usr/share/zoneinfo/localtime -> /etc/localtime symlink with
your libc package. I think this is how it's often done with glibc.

The TZ=":name" files are searched from:
  /usr/share/zoneinfo/
  /share/zoneinfo/
  /etc/zoneinfo/

- Timo

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.