Page MenuHomeFreeBSD

tzcode: Fix issues when TZ is an absolute path
ClosedPublic

Authored by des on Sep 26 2025, 5:57 PM.
Tags
None
Referenced Files
F161457770: D52753.diff
Fri, Jul 3, 11:59 PM
F161396891: D52753.diff
Fri, Jul 3, 10:24 AM
Unknown Object (File)
Tue, Jun 30, 11:03 PM
Unknown Object (File)
Fri, Jun 26, 2:34 AM
Unknown Object (File)
Mon, Jun 15, 3:25 AM
Unknown Object (File)
Sat, Jun 13, 8:39 PM
Unknown Object (File)
May 19 2026, 10:00 PM
Unknown Object (File)
May 17 2026, 1:24 PM
Subscribers

Details

Summary
  • If TZ starts with TZDIR, strip any additional slashes so relname does not end up looking like an absolute path. For instance, TZ=/usr/share/zoneinfo//UTC should result in UTC, not /UTC.
  • In the setugid case, we were incorrectly passing name rather than relname to fstatat().
  • Modify the tz_env and tz_env_setugid test cases to exercise both of these scenarios.
  • Also add test cases for invalid values of TZ, which I wrote earlier but forgot to include in a5f14e4f9069.

Reported by: Paul Eggert <eggert@cs.ucla.edu>
MFC after: 3 days
Fixes: 967a49a21a27 ("Update tzcode to 2025b")
Fixes: a5f14e4f9069 ("tzcode: Use -00 only for invalid time zones")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable