From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id D359823DEF for ; Tue, 5 Mar 2024 21:12:44 +0100 (CET) Received: (qmail 22131 invoked by uid 550); 5 Mar 2024 20:08:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 22090 invoked from network); 5 Mar 2024 20:08:48 -0000 Date: Tue, 5 Mar 2024 15:12:47 -0500 From: Rich Felker To: =?utf-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh Cc: Russ Allbery , tz@iana.org, musl@lists.openwall.com Message-ID: <20240305201247.GE4163@brightrain.aerifal.cx> References: <87edcqv69m.fsf@hope.eyrie.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Re: [tz] Weird PST8PDT and EST5EDT behavior on Alpine Linux On Tue, Mar 05, 2024 at 10:52:23AM +0700, Đoàn Trần Công Danh wrote: > On 2024-03-03 22:51:49-0800, Russ Allbery via tz wrote: > > Why would the system decide that time stamp should use daylight saving > > time? The system time zone is set to UTC, so it shouldn't be some sort of > > contamination from it. Or is this some odd bug in the busybox date > > command? It works correctly with busybox 1.36.1 on a Debian system, > > though: > > > > % busybox env TZ=PST8PDT date -R -d @1643145780 > > Tue, 25 Jan 2022 13:23:00 -0800 > > > > The Alpine Linux system in question does have PST8PDT and EST5EDT files in > > /usr/share/zoneinfo. The Olson time zone identifiers do work as expected: > > > Please correct me if I were wrong! > (also added musl-lib list) > > I believe it's musl-libc's behaviours. > > Both PST8PDT and EST5EDT are timezones in POSIX form. > musl specificly check for that first [1]. > > Time POSIX form is (space inserted for clarity): > > std offset[dst[offset][,start[/time],end[/time]]] > > But seems like nothings was enforced if rule isnot given in the > timezone, which makes it open to intepretion. > > Musl inteprete that as no transition at all [2]. Yes, it's not clear to me (POSIX doesn't seem to specify) what the default rules should be when none are specified. However, it is clear that these strings meet the syntax for the POSIX TZ form, and thus musl does not attempt to interpret them as filenames, which could result in behavior contrary to the specified meaning. If you want to use a file by that name, the safe way to request that is by prefixing it with a colon, as in TZ=:PST8PDT Rich