1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-04 16:45:06 -05:00

Revert "file: on Windows, refuse paths that start with \\"

This reverts commit 1b71bc532b.

Reminded-by: Chris Roberts
Bug: https://curl.haxx.se/mail/archive-2020-04/0013.html

Closes #5215
This commit is contained in:
Daniel Stenberg 2020-04-10 23:52:06 +02:00
parent 53f4070827
commit 5afa07fab5
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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)) {