Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F96479919
D38035.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
D38035.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
@@ -468,7 +468,6 @@
register int fid;
register int stored;
register ssize_t nread;
- register bool doaccess;
register union input_buffer *up = &lsp->u.u;
register int tzheadsize = sizeof(struct tzhead);
@@ -482,15 +481,7 @@
if (name[0] == ':')
++name;
-#ifdef SUPPRESS_TZDIR
- /* Do not prepend TZDIR. This is intended for specialized
- applications only, due to its security implications. */
- doaccess = true;
-#else
- doaccess = name[0] == '/';
-#endif
- if (!doaccess) {
- char const *dot;
+ if (name[0] != '/') {
if (sizeof lsp->fullname - sizeof tzdirslash <= strlen(name))
return ENAMETOOLONG;
@@ -500,20 +491,8 @@
memcpy(lsp->fullname, tzdirslash, sizeof tzdirslash);
strcpy(lsp->fullname + sizeof tzdirslash, name);
- /* Set doaccess if NAME contains a ".." file name
- component, as such a name could read a file outside
- the TZDIR virtual subtree. */
- for (dot = name; (dot = strchr(dot, '.')); dot++)
- if ((dot == name || dot[-1] == '/') && dot[1] == '.'
- && (dot[2] == '/' || !dot[2])) {
- doaccess = true;
- break;
- }
-
name = lsp->fullname;
}
- if (doaccess && access(name, R_OK) != 0)
- return errno;
if (doextend) {
/*
* Detect if the timezone file has changed. Check
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 26, 3:15 AM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12757667
Default Alt Text
D38035.diff (1 KB)
Attached To
Mode
D38035: tzcode: Remove access() again, cf. 02ba1d993fa9.
Attached
Detach File
Event Timeline
Log In to Comment