]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/getdate.y: Ignore time-zone information and use UTC
authorAlejandro Colomar <alx@kernel.org>
Mon, 17 Feb 2025 23:41:56 +0000 (00:41 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 2 Mar 2025 04:11:46 +0000 (22:11 -0600)
commit00c78bfab3ce05a62393d113a247574f5038a90f
treefc071463bfb55bb20899e70a6e98052236afbb2d
parentbee77ffc291dfed2a133496db465eaa55e2b0fec
lib/getdate.y: Ignore time-zone information and use UTC

There is exactly one caller of this function, and it wants a date, not a
time.  It is useless to be able to parse local dates, because we
ultimately store a UTC date.  To avoid confusion, unconditionally use
UTC.  Since this code had important bugs regarding offset, we can safely
assume that no existing users rely on being able to use their local
date (this never worked correctly).

Also, the code parsing time zones is quite bad, for today's standards.

Link: <https://github.com/shadow-maint/shadow/issues/1202>
Link: <https://github.com/shadow-maint/shadow/issues/1209>
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Reported-by: Tim Parenti <tim@timtimeonline.com>
Reported-by: Lee Garrett <lgarrett@rocketjump.eu>
Cc: Gus Kenion <https://github.com/kenion>
Cc: Michael Vetter <jubalh@iodoru.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/getdate.y