This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING^2] RFC [PATCH] BZ#1077902: New API gettimezone
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Carlos O'Donell <carlos at redhat dot com>, P J P <pj dot pandit at yahoo dot co dot in>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Thu, 01 May 2014 20:03:40 -0700
- Subject: Re: [PING^2] RFC [PATCH] BZ#1077902: New API gettimezone
- Authentication-results: sourceware.org; auth=none
- References: <1396499286 dot 85118 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <53497633 dot 6060804 at redhat dot com> <1397324033 dot 69177 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <5349A4B0 dot 2070206 at redhat dot com> <1397375798 dot 36419 dot YahooMailNeo at web192401 dot mail dot sg3 dot yahoo dot com> <1397414803 dot 70882 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <534B8A9F dot 8030806 at redhat dot com> <1397469748 dot 42212 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <1398146221 dot 72442 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <1398755742 dot 94004 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <535F74EE dot 8010002 at redhat dot com> <1398775268 dot 92264 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <535FC11B dot 3000906 at cs dot ucla dot edu> <1398801168 dot 81041 dot YahooMailNeo at web192406 dot mail dot sg3 dot yahoo dot com> <5360378D dot 1060306 at cs dot ucla dot edu> <1398872997 dot 84757 dot YahooMailNeo at web192402 dot mail dot sg3 dot yahoo dot com> <53614148 dot 90603 at cs dot ucla dot edu> <5361D8D1 dot 60400 at redhat dot com> <5361E805 dot 9080606 at cs dot ucla dot edu> <5361F22E dot 3070206 at redhat dot com> <53628A02 dot 9080702 at cs dot ucla dot edu> <53629388 dot 1060301 at redhat dot com>
Carlos O'Donell wrote:
Assumptions:
- Server and chroot have updated and matching zone info files.
- You don't control the server e.g. OpenShift Gears or Docker.
Another assumption: tz files don't change while applications are
running, as the apps typically won't notice the change.
(1) Have the administrator of the server set the TZ env var to match
/etc/localtime.
This should work but it's overkill.
(2) Copy the /etc/localtime file from the server to the chroot.
This should also work, but it's also overkill. /etc/localtime is a zone
info file, and you are already assuming that the containing server and
the chrooted jail have matching zone info files. Therefore,
/etc/localtime already matches, and there's no need to copy it.
If your assumption is violated and zone info files do not match, you and
your containing-server admin need to decide collectively whether this
mismatch is your problem or your server admin's problem, and then you
and/or your server admin should fix the problem. This is true
regardless of whether we change the glibc API in this area.
Because the server admin's goal should be to make your life easier,
there should be no need for you to repair mismatched zone info files;
they should just match. But if they don't match, and if you don't have
the time or political oomph to get your server admin to fix them, then
you need to fix your chrooted copy.
(3) Provide an API for users to learn what their zone is.
This should work if the API is fancy enough, but any such API (A) would
need to be designed and implemented and tested and maintained, and (B)
would probably expose some aspect of glibc internals. Down the road (B)
would likely cause more trouble than it'd cure. Even (A) sounds like
it's more trouble than the problem is worth.
Is you opinion that (1) is the correct solution?
(1) should work under the assumptions you gave, so in that sense it's
correct; but it's not the only working solution and I would suggest
something different.