From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5025 Path: news.gmane.org!not-for-mail From: Timo Teras Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: ctime, timezone? Date: Fri, 2 May 2014 08:10:33 +0300 Message-ID: <20140502081033.24bb01c8@vostro> References: <20140502080656.659b723f@vostro> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1399007447 14535 80.91.229.3 (2 May 2014 05:10:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 May 2014 05:10:47 +0000 (UTC) Cc: musl@lists.openwall.com, josiahw@gmail.com To: Timo Teras Original-X-From: musl-return-5029-gllmg-musl=m.gmane.org@lists.openwall.com Fri May 02 07:10:42 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Wg5k9-0002Oi-Ln for gllmg-musl@plane.gmane.org; Fri, 02 May 2014 07:10:41 +0200 Original-Received: (qmail 3363 invoked by uid 550); 2 May 2014 05:10:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3355 invoked from network); 2 May 2014 05:10:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=SZNnpDSyQV1uWTel5jZZZqb/r5uASpjTUHeDZ3akKUg=; b=RpTwhvxnViwnnFDPpa/nQ5NbAuIdKQnw/QXCS399xE5kmXLSxXkfgBUdgawFt8Rq9L l8G68muZAx8EBrSPsV+1VJtYtKMVC3z+Fv0Jzm0kk/2nW4rXh4hXbWG/s67uw07AD+E3 3Glsd576CCjvEG6oQYszA7uiOnF/F2fC6V16atbE79SBv1PTL66P/58Z+9Q73Ga+GoRq k0wM+vA/NkdIK3n9KEbcnq1X+bZvA4Q7MBqN1IRgIVxd3gPlzAr7CzC1F7Awct9cxBau /T+bp24bX/D34NqJ3rKYmmhBdKqdj+/MEp7Cl4Z2EZtBgfYKxmElWgRt9be3VG+CbFCo s8QA== X-Received: by 10.112.137.39 with SMTP id qf7mr10021970lbb.18.1399007429277; Thu, 01 May 2014 22:10:29 -0700 (PDT) Original-Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= In-Reply-To: <20140502080656.659b723f@vostro> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; i486-alpine-linux-musl) Xref: news.gmane.org gmane.linux.lib.musl.general:5025 Archived-At: On Fri, 2 May 2014 08:06:56 +0300 Timo Teras wrote: > On Thu, 1 May 2014 17:18:32 -0500 > Josiah Worcester wrote: > > > On Thu, May 1, 2014 at 5:00 PM, John Mudd > > 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