tzcode: Test escape from TZDIRTest a value of TZ that temporarily escapes from TZDIR (which is notpermitted when setugid) then reenters it.MFC after: 3 days
tzcode: Fix issues when TZ is an absolute path* 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/zone
tzcode: Fix issues when TZ is an absolute path* 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 daysFixes: 967a49a21a27 ("Update tzcode to 2025b")Fixes: a5f14e4f9069 ("tzcode: Use -00 only for invalid time zones")Reviewed by: philipDifferential Revision: https://reviews.freebsd.org/D52753
show more ...
tzcode: Add a test case for plain issetugid caseThis catches a bug in tzcode which incorrectly considers TZDEFAULT asunsafe as if it came from the environment.Also deduplicate some repeated code
tzcode: Add a test case for plain issetugid caseThis catches a bug in tzcode which incorrectly considers TZDEFAULT asunsafe as if it came from the environment.Also deduplicate some repeated code, and fix a missing mode in anopen(2) call with O_CREAT set.Event: Oslo Hackathon 202508Reviewed by: philipDifferential Revision: https://reviews.freebsd.org/D52241
tzcode: Add a test case for thin jailsAdd a test case for a typical thin jail scenario where TZDIR does notexist and we get our information from /etc/localtime. This istechnically already covere
tzcode: Add a test case for thin jailsAdd a test case for a typical thin jail scenario where TZDIR does notexist and we get our information from /etc/localtime. This istechnically already covered by the detect_tz_changes test case, butthis new test case is independent of the DETECT_TZ_CHANGES option.
tzcode: Add test case for setugid programsFixes: a6b19979bf13 ("tzcode: Fix TZ for non-setugid programs")Differential Revision: https://reviews.freebsd.org/D52124
tzcode: Fix TZ for non-setugid programsThe previous commit had the desired effect for setugid programs, butbroke TZ for everyone else. I didn't notice because my test casesswap out /etc/localtim
tzcode: Fix TZ for non-setugid programsThe previous commit had the desired effect for setugid programs, butbroke TZ for everyone else. I didn't notice because my test casesswap out /etc/localtime instead of setting TZ, so add a test casethat sets TZ.Fixes: b6ea2513f776 ("tzcode: Limit TZ for setugid programs")Reviewed by: cyDifferential Revision: https://reviews.freebsd.org/D52108
libc: Test time zone change detection.While here, clean the detection code up a bit.Sponsored by: Klara, Inc.Sponsored by: NetApp, Inc.Reviewed by: markjDifferential Revision: https://reviews.
libc: Test time zone change detection.While here, clean the detection code up a bit.Sponsored by: Klara, Inc.Sponsored by: NetApp, Inc.Reviewed by: markjDifferential Revision: https://reviews.freebsd.org/D51343
strptime: Fix day-of-week calculation.The day-of-week calculation used the raw year value without adjustingfor TM_YEAR_BASE, so it was off by one for 300 years out of every 400;it just happened t
strptime: Fix day-of-week calculation.The day-of-week calculation used the raw year value without adjustingfor TM_YEAR_BASE, so it was off by one for 300 years out of every 400;it just happened to be correct for 1901 through 2000. It also used aloop where a simple addition would have sufficed.While here, simplify our version of Gauss's algorithm, and documentthat we assume the Gregorian calendar.MFC after: 1 weekPR: 282916Reviewed by: imp, allanjude, philipDifferential Revision: https://reviews.freebsd.org/D47977