HomeFreeBSD

tzcode: Don't treat TZDEFAULT as tainted

Description

tzcode: Don't treat TZDEFAULT as tainted

tzset() calls zoneinit() with the FROMENV flag set unconditionally, so
if TZ is unset and we use TZDEFAULT instead, we were still treating it
as if it came from the environment. Unset the FROMENV flag if name is
null and we switch to TZDEFAULT, or if, after skipping the optional
leading colon, we find that name is identical to TZDEFAULT.

This incorporates upstream change d0e0b00f846c ("Avoid unnecessary
access, stat calls").

Fixes: b6ea2513f776 ("tzcode: Limit TZ for setugid programs")
Event: Oslo Hackathon 202508
Reviewed by: philip
Differential Revision: https://reviews.freebsd.org/D52240

Details

Provenance
desAuthored on Sep 1 2025, 6:33 AM
Reviewer
philip
Differential Revision
D52240: tzcode: Don't treat TZDEFAULT as tainted
Parents
rG004ce88ad1ef: mpr: Add workaround for too few slots being automatically scanned
Branches
Unknown
Tags
Unknown