diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-04-10 23:52:06 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-04-11 18:20:38 +0200 |
commit | 5afa07fab57a8a06be0a6de577352d622f51b7ba (patch) | |
tree | cfc9757acf65fcc409b8f1e62eaf46fe4466cf62 /lib | |
parent | 53f407082746e7e57534595957616b8d56905ad5 (diff) |
Revert "file: on Windows, refuse paths that start with \\"
This reverts commit 1b71bc532bde8621fd3260843f8197182a467ff2.
Reminded-by: Chris Roberts
Bug: https://curl.haxx.se/mail/archive-2020-04/0013.html
Closes #5215
Diffstat (limited to 'lib')
-rw-r--r-- | lib/file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/file.c b/lib/file.c index 249237073..576a79463 100644 --- a/lib/file.c +++ b/lib/file.c @@ -136,7 +136,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done) struct Curl_easy *data = conn->data; char *real_path; struct FILEPROTO *file = data->req.protop; - int fd = -1; + int fd; #ifdef DOS_FILESYSTEM size_t i; char *actual_path; @@ -181,9 +181,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done) return CURLE_URL_MALFORMAT; } - if(strncmp("\\\\", actual_path, 2)) - /* refuse to open path that starts with two backslashes */ - fd = open_readonly(actual_path, O_RDONLY|O_BINARY); + fd = open_readonly(actual_path, O_RDONLY|O_BINARY); file->path = actual_path; #else if(memchr(real_path, 0, real_path_len)) { |