Index | Thread | Search

From:
Todd C. Miller <millert@openbsd.org>
Subject:
tzset.3: document other reasons to call tzset()
To:
tech@openbsd.org
Date:
Wed, 03 Apr 2024 20:25:04 -0600

Download raw body.

Thread
We no longer allow fully-qualified files to be specified in TZ, but
programs using pledge(2) or unveil(2) may still wish to call tzset(3)
to allow for tighter restrictions.  Also, UTC is used for invalid
TZ values.

OK?

 - todd

Index: lib/libc/time/tzset.3
===================================================================
RCS file: /cvs/src/lib/libc/time/tzset.3,v
retrieving revision 1.26
diff -u -p -u -r1.26 tzset.3
--- lib/libc/time/tzset.3	4 Oct 2022 13:33:57 -0000	1.26
+++ lib/libc/time/tzset.3	4 Apr 2024 02:21:09 -0000
@@ -40,13 +40,14 @@ Most programs do not need to call
 directly; it will be called automatically as needed by the functions
 described in
 .Xr localtime 3 .
-Privileged processes that use
-.Xr chroot 2
-may wish to call
+Security-conscious programs may wish to call
 .Fn tzset
-to initialize the time conversion information before changing to
-a restricted root directory that does not include time conversion
-data files.
+to initialize the time conversion information before calling
+.Xr chroot 2 ,
+.Xr pledge 2 ,
+or
+.Xr unveil 2 .
+Otherwise, the program may not have access to the time conversion data files.
 .Pp
 If
 .Ev TZ
@@ -90,8 +91,9 @@ is always treated as a pathname.
 .Pp
 If
 .Ev TZ
-is set to the empty string, Coordinated Universal Time (UTC) is
-used (without leap second correction).
+is set to the empty string or a value that cannot be parsed using
+the rules below, Coordinated Universal Time (UTC) is used (without
+leap second correction).
 .Pp
 When
 .Ev TZ