Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143742215
D52240.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52240.diff
View Options
diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c
--- a/contrib/tzcode/localtime.c
+++ b/contrib/tzcode/localtime.c
@@ -615,6 +615,7 @@
name = TZDEFAULT;
if (! name)
return EINVAL;
+ tzloadflags &= ~TZLOAD_FROMENV;
}
if (name[0] == ':')
@@ -670,11 +671,13 @@
fid = _open(name, (O_RDONLY | O_BINARY | O_CLOEXEC | O_CLOFORK
| O_IGNORE_CTTY | O_NOCTTY));
#else /* __FreeBSD__ */
+ if ((tzloadflags & TZLOAD_FROMENV) && strcmp(name, TZDEFAULT) == 0)
+ tzloadflags &= ~TZLOAD_FROMENV;
relname = name;
if (strncmp(relname, TZDIR "/", strlen(TZDIR) + 1) == 0)
relname += strlen(TZDIR) + 1;
dd = _open(TZDIR, O_DIRECTORY | O_RDONLY);
- if (issetugid() && (tzloadflags & TZLOAD_FROMENV)) {
+ if ((tzloadflags & TZLOAD_FROMENV) && issetugid()) {
if (dd < 0)
return errno;
if (fstatat(dd, name, &sb, AT_RESOLVE_BENEATH) < 0) {
@@ -1624,14 +1627,13 @@
static void
tzset_unlocked(void)
{
+ char const *name = getenv("TZ");
#ifdef __FreeBSD__
- tzset_unlocked_name(getenv("TZ"));
+ tzset_unlocked_name(name);
}
static void
tzset_unlocked_name(char const *name)
{
-#else
- char const *name = getenv("TZ");
#endif
struct state *sp = lclptr;
int lcl = name ? strlen(name) < sizeof lcl_TZname : -1;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 1, 10:22 AM (4 h, 18 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28342106
Default Alt Text
D52240.diff (1 KB)
Attached To
Mode
D52240: tzcode: Don't treat TZDEFAULT as tainted
Attached
Detach File
Event Timeline
Log In to Comment