diff options
author | ng0 <ng0@n0.is> | 2019-06-07 16:10:38 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-06-07 16:10:38 +0000 |
commit | 61c8b4c19e66a9a70ebd5e2ade322859ae038d35 (patch) | |
tree | 586e98e8a1a8af9cf9388f4f6dd768091dfa3965 /src | |
parent | 7959939f112e7a86a0df994e19f02f5c198eb28a (diff) | |
parent | 69248b58f649e35b09a126c12781353e3471f5c6 (diff) | |
download | gnurl-61c8b4c19e66a9a70ebd5e2ade322859ae038d35.tar.gz gnurl-61c8b4c19e66a9a70ebd5e2ade322859ae038d35.tar.bz2 gnurl-61c8b4c19e66a9a70ebd5e2ade322859ae038d35.zip |
Merge tag 'curl-7_65_1' of https://github.com/curl/curl
7.65.1
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_help.c | 8 | ||||
-rw-r--r-- | src/tool_parsecfg.c | 20 | ||||
-rw-r--r-- | src/tool_setopt.c | 52 | ||||
-rw-r--r-- | src/tool_setopt.h | 41 |
4 files changed, 89 insertions, 32 deletions
diff --git a/src/tool_help.c b/src/tool_help.c index ad6b6a107..9209a13dd 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -335,8 +335,8 @@ static const struct helptxt helptext[] = { "SPNEGO proxy service name"}, {" --proxy-ssl-allow-beast", "Allow security flaw for interop for HTTPS proxy"}, - {" --proxy-tls13-ciphers <ciphersuite list>", - "TLS 1.3 proxy cipher suites"}, + {" --proxy-tls13-ciphers <list>", + "TLS 1.3 ciphersuites for proxy (OpenSSL)"}, {" --proxy-tlsauthtype <type>", "TLS authentication type for HTTPS proxy"}, {" --proxy-tlspassword <string>", @@ -445,8 +445,8 @@ static const struct helptxt helptext[] = { "Transfer based on a time condition"}, {" --tls-max <VERSION>", "Set maximum allowed TLS version"}, - {" --tls13-ciphers <list of TLS 1.3 ciphersuites>", - "TLS 1.3 cipher suites to use"}, + {" --tls13-ciphers <list>", + "TLS 1.3 ciphersuites (OpenSSL)"}, {" --tlsauthtype <type>", "TLS authentication type"}, {" --tlspassword", diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index e36b06c23..36c7bccf0 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -46,7 +46,7 @@ static char *my_get_line(FILE *fp); /* return 0 on everything-is-fine, and non-zero otherwise */ int parseconfig(const char *filename, struct GlobalConfig *global) { - FILE *file; + FILE *file = NULL; char filebuffer[512]; bool usedarg = FALSE; int rc = 0; @@ -69,7 +69,6 @@ int parseconfig(const char *filename, struct GlobalConfig *global) */ file = fopen(filebuffer, FOPEN_READTEXT); if(file != NULL) { - fclose(file); filename = filebuffer; } else { @@ -77,8 +76,9 @@ int parseconfig(const char *filename, struct GlobalConfig *global) * already declared via inclusions done in setup header file. * We assume that we are using the ASCII version here. */ - int n = GetModuleFileNameA(0, filebuffer, sizeof(filebuffer)); - if(n > 0 && n < (int)sizeof(filebuffer)) { + unsigned long len = GetModuleFileNameA(0, filebuffer, + sizeof(filebuffer)); + if(len > 0 && len < sizeof(filebuffer)) { /* We got a valid filename - get the directory part */ char *lastdirchar = strrchr(filebuffer, '\\'); if(lastdirchar) { @@ -110,10 +110,12 @@ int parseconfig(const char *filename, struct GlobalConfig *global) #endif } - if(strcmp(filename, "-")) - file = fopen(filename, FOPEN_READTEXT); - else - file = stdin; + if(!file) { /* WIN32: no need to fopen() again */ + if(strcmp(filename, "-")) + file = fopen(filename, FOPEN_READTEXT); + else + file = stdin; + } if(file) { char *line; diff --git a/src/tool_setopt.c b/src/tool_setopt.c index 745b4546e..ff67c22e7 100644 --- a/src/tool_setopt.c +++ b/src/tool_setopt.c @@ -713,4 +713,56 @@ CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *config, return ret; } +#else /* CURL_DISABLE_LIBCURL_OPTION */ + +#include "tool_cfgable.h" +#include "tool_setopt.h" + #endif /* CURL_DISABLE_LIBCURL_OPTION */ + +CURLcode tool_real_error(CURLcode result, CURLoption tag) +{ +#ifdef CURL_DISABLE_PROXY + switch(tag) { + case CURLOPT_HAPROXYPROTOCOL: + case CURLOPT_HTTPPROXYTUNNEL: + case CURLOPT_NOPROXY: + case CURLOPT_PRE_PROXY: + case CURLOPT_PROXY: + case CURLOPT_PROXYAUTH: + case CURLOPT_PROXY_CAINFO: + case CURLOPT_PROXY_CAPATH: + case CURLOPT_PROXY_CRLFILE: + case CURLOPT_PROXYHEADER: + case CURLOPT_PROXY_KEYPASSWD: + case CURLOPT_PROXYPASSWORD: + case CURLOPT_PROXY_PINNEDPUBLICKEY: + case CURLOPT_PROXYPORT: + case CURLOPT_PROXY_SERVICE_NAME: + case CURLOPT_PROXY_SSLCERT: + case CURLOPT_PROXY_SSLCERTTYPE: + case CURLOPT_PROXY_SSL_CIPHER_LIST: + case CURLOPT_PROXY_SSLKEY: + case CURLOPT_PROXY_SSLKEYTYPE: + case CURLOPT_PROXY_SSL_OPTIONS: + case CURLOPT_PROXY_SSL_VERIFYHOST: + case CURLOPT_PROXY_SSL_VERIFYPEER: + case CURLOPT_PROXY_SSLVERSION: + case CURLOPT_PROXY_TLS13_CIPHERS: + case CURLOPT_PROXY_TLSAUTH_PASSWORD: + case CURLOPT_PROXY_TLSAUTH_TYPE: + case CURLOPT_PROXY_TLSAUTH_USERNAME: + case CURLOPT_PROXY_TRANSFER_MODE: + case CURLOPT_PROXYTYPE: + case CURLOPT_PROXYUSERNAME: + case CURLOPT_PROXYUSERPWD: + return CURLE_OK; /* pretend it worked */ + default: + break; + } +#else + (void)tag; +#endif + return result; +} + diff --git a/src/tool_setopt.h b/src/tool_setopt.h index 663041f65..2266d1c9c 100644 --- a/src/tool_setopt.h +++ b/src/tool_setopt.h @@ -29,11 +29,14 @@ * Macros used in operate() */ -#define SETOPT_CHECK(v) do { \ - result = (v); \ - if(result) \ - goto show_error; \ -} WHILE_FALSE +#define SETOPT_CHECK(v,opt) do { \ + result = tool_real_error((v), opt); \ + if(result) \ + goto show_error; \ + } WHILE_FALSE + +/* allow removed features to simulate success: */ +CURLcode tool_real_error(CURLcode result, CURLoption tag); #ifndef CURL_DISABLE_LIBCURL_OPTION @@ -97,25 +100,25 @@ CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *config, const char *name, CURLoption tag, ...); #define my_setopt(x,y,z) \ - SETOPT_CHECK(tool_setopt(x, FALSE, global, #y, y, z)) + SETOPT_CHECK(tool_setopt(x, FALSE, global, #y, y, z), y) #define my_setopt_str(x,y,z) \ - SETOPT_CHECK(tool_setopt(x, TRUE, global, #y, y, z)) + SETOPT_CHECK(tool_setopt(x, TRUE, global, #y, y, z), y) #define my_setopt_enum(x,y,z) \ - SETOPT_CHECK(tool_setopt_enum(x, global, #y, y, setopt_nv_ ## y, z)) + SETOPT_CHECK(tool_setopt_enum(x, global, #y, y, setopt_nv_ ## y, z), y) #define my_setopt_flags(x,y,z) \ - SETOPT_CHECK(tool_setopt_flags(x, global, #y, y, setopt_nv_ ## y, z)) + SETOPT_CHECK(tool_setopt_flags(x, global, #y, y, setopt_nv_ ## y, z), y) #define my_setopt_bitmask(x,y,z) \ - SETOPT_CHECK(tool_setopt_bitmask(x, global, #y, y, setopt_nv_ ## y, z)) + SETOPT_CHECK(tool_setopt_bitmask(x, global, #y, y, setopt_nv_ ## y, z), y) #define my_setopt_mimepost(x,y,z) \ - SETOPT_CHECK(tool_setopt_mimepost(x, global, #y, y, z)) + SETOPT_CHECK(tool_setopt_mimepost(x, global, #y, y, z), y) #define my_setopt_slist(x,y,z) \ - SETOPT_CHECK(tool_setopt_slist(x, global, #y, y, z)) + SETOPT_CHECK(tool_setopt_slist(x, global, #y, y, z), y) #define res_setopt(x,y,z) tool_setopt(x, FALSE, global, #y, y, z) @@ -126,25 +129,25 @@ CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *config, /* No --libcurl, so pass options directly to library */ #define my_setopt(x,y,z) \ - SETOPT_CHECK(curl_easy_setopt(x, y, z)) + SETOPT_CHECK(curl_easy_setopt(x, y, z), y) #define my_setopt_str(x,y,z) \ - SETOPT_CHECK(curl_easy_setopt(x, y, z)) + SETOPT_CHECK(curl_easy_setopt(x, y, z), y) #define my_setopt_enum(x,y,z) \ - SETOPT_CHECK(curl_easy_setopt(x, y, z)) + SETOPT_CHECK(curl_easy_setopt(x, y, z), y) #define my_setopt_flags(x,y,z) \ - SETOPT_CHECK(curl_easy_setopt(x, y, z)) + SETOPT_CHECK(curl_easy_setopt(x, y, z), y) #define my_setopt_bitmask(x,y,z) \ - SETOPT_CHECK(curl_easy_setopt(x, y, z)) + SETOPT_CHECK(curl_easy_setopt(x, y, z), y) #define my_setopt_mimepost(x,y,z) \ - SETOPT_CHECK(curl_easy_setopt(x, y, z)) + SETOPT_CHECK(curl_easy_setopt(x, y, z), y) #define my_setopt_slist(x,y,z) \ - SETOPT_CHECK(curl_easy_setopt(x, y, z)) + SETOPT_CHECK(curl_easy_setopt(x, y, z), y) #define res_setopt(x,y,z) curl_easy_setopt(x,y,z) |