mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Timo Teras <timo.teras@iki.fi>
To: musl@lists.openwall.com
Cc: josiahw@gmail.com
Subject: Re: Re: ctime, timezone?
Date: Fri, 2 May 2014 08:06:56 +0300	[thread overview]
Message-ID: <20140502080656.659b723f@vostro> (raw)
In-Reply-To: <CAMAJcuBQ4raMCsdmVOFJZOeKbZOeWYr3FXOUSTPf+Wp9Pg_wWw@mail.gmail.com>

On Thu, 1 May 2014 17:18:32 -0500
Josiah Worcester <josiahw@gmail.com> wrote:

> On Thu, May 1, 2014 at 5:00 PM, John Mudd <johnbmudd@gmail.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.

- Timo


  reply	other threads:[~2014-05-02  5:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01 20:37 John Mudd
2014-05-01 20:56 ` Josiah Worcester
2014-05-01 21:57   ` Josiah Worcester
2014-05-01 21:57 ` John Mudd
2014-05-01 22:00   ` John Mudd
2014-05-01 22:18     ` Josiah Worcester
2014-05-02  5:06       ` Timo Teras [this message]
2014-05-02  5:10         ` Timo Teras
2014-05-01 22:47     ` Laurent Bercot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140502080656.659b723f@vostro \
    --to=timo.teras@iki.fi \
    --cc=josiahw@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).