summaryrefslogtreecommitdiff
path: root/src/tool_getparam.c
Commit message (Collapse)AuthorAgeFilesLines
* curl: make sure setopt CURLOPT_IPRESOLVE passes on a longDaniel Stenberg2020-10-051-2/+2
| | | | | | | | | | Previously, it would pass on a define (int) which could make libcurl read junk as a value - which prevented the CURLOPT_IPRESOLVE option to "take". This could then make test 2100 do two DoH requests instead of one! Fixes #6042 Closes #6043
* --help: strdup the categoryDaniel Stenberg2020-09-181-1/+5
| | | | | | | | | | ... since it is converted and the original pointer is freed on Windows unicode handling. Follow-up to aa8777f63febc Fixes #5977 Closes #5978 Reported-by: xwxbug on github
* tool: update --help with categoriesEmil Engler2020-09-041-0/+1
| | | | | | This commit is a part of "--help me if you can" Closes #5680
* tls: add CURLOPT_SSL_EC_CURVES and --curvesMichael Baentsch2020-08-301-0/+5
| | | | Closes #5892
* curl: add --output-dirDaniel Stenberg2020-08-241-0/+5
| | | | | | | | Works with --create-dirs and with -J Add test 3008, 3009, 3011, 3012 and 3013 to verify. Closes #5637
* content_encoding: add zstd decoding supportGilles Vollant2020-07-121-1/+2
| | | | | | | | | include zstd curl patch for Makefile.m32 from vszakats and include Add CMake support for zstd from Peter Wu Helped-by: Viktor Szakats Helped-by: Peter Wu Closes #5453
* tool_getparam: make --krb option work againKamil Dudka2020-07-031-1/+1
| | | | | | | It was disabled by mistake in commit curl-7_37_1-23-ge38ba4301. Bug: https://bugzilla.redhat.com/1833193 Closes #5640
* terminology: call them null-terminated stringsDaniel Stenberg2020-06-281-2/+2
| | | | | | | | | | | Updated terminology in docs, comments and phrases to refer to C strings as "null-terminated". Done to unify with how most other C oriented docs refer of them and what users in general seem to prefer (based on a single highly unscientific poll on twitter). Reported-by: coinhubs on github Fixes #5598 Closes #5608
* tool_getparam: -i is not OK if -J is usedDaniel Stenberg2020-06-221-0/+5
| | | | | Reported-by: sn on hackerone Bug: https://curl.haxx.se/docs/CVE-2020-8177.html
* tool_getparam: repair the error message for unknown flagDaniel Stenberg2020-06-181-1/+2
| | | | | | | Follow-up to 9e5669f3880674 Detected by Coverity CID 1464582 ("Logically dead code") Closes #5577
* tool_getparam: fix memory leak in parse_argsJay Satiro2020-06-091-0/+2
| | | | | | | | | Prior to this change in Windows Unicode builds most parsed options would not be freed. Found using _CrtDumpMemoryLeaks(). Ref: https://github.com/curl/curl/issues/5545
* tool: support UTF-16 command line on WindowsMarcel Raad2020-05-141-7/+10
| | | | | | | | | | | | | | | | | | - use `wmain` instead of `main` when `_UNICODE` is defined [0] - define `argv_item_t` as `wchar_t *` in this case - use the curl_multibyte gear to convert the command-line arguments to UTF-8 This makes it possible to pass parameters with characters outside of the current locale on Windows, which is required for some tests, e.g. the IDN tests. Out of the box, this currently only works with the Visual Studio project files, which default to Unicode, and winbuild with the `ENABLE_UNICODE` option. [0] https://devblogs.microsoft.com/oldnewthing/?p=40643 Ref: https://github.com/curl/curl/issues/3747 Closes https://github.com/curl/curl/pull/3784
* tool: Add option --retry-all-errors to retry on any errorJay Satiro2020-05-121-0/+4
| | | | | | The "sledgehammer" of retrying. Closes https://github.com/curl/curl/pull/5185
* cmdline: fix handling of OperationConfig linked list (--next)Rici Lake2020-03-201-0/+1
| | | | | | | | | | Ensures that -K/--config inserts new items at the end of the list instead of overwriting the second item, and that after a -K/--config option has been parsed, the option parser's view of the current config is update. Fixes #5120 Closes #5123
* schannel: add "best effort" revocation check optionJohannes Schindelin2020-03-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement new option CURLSSLOPT_REVOKE_BEST_EFFORT and --ssl-revoke-best-effort to allow a "best effort" revocation check. A best effort revocation check ignores errors that the revocation check was unable to take place. The reasoning is described in detail below and discussed further in the PR. --- When running e.g. with Fiddler, the schannel backend fails with an unhelpful error message: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate. Sadly, many enterprise users who are stuck behind MITM proxies suffer the very same problem. This has been discussed in plenty of issues: https://github.com/curl/curl/issues/3727, https://github.com/curl/curl/issues/264, for example. In the latter, a Microsoft Edge developer even made the case that the common behavior is to ignore issues when a certificate has no recorded distribution point for revocation lists, or when the server is offline. This is also known as "best effort" strategy and addresses the Fiddler issue. Unfortunately, this strategy was not chosen as the default for schannel (and is therefore a backend-specific behavior: OpenSSL seems to happily ignore the offline servers and missing distribution points). To maintain backward-compatibility, we therefore add a new flag (`CURLSSLOPT_REVOKE_BEST_EFFORT`) and a new option (`--ssl-revoke-best-effort`) to select the new behavior. Due to the many related issues Git for Windows and GitHub Desktop, the plan is to make this behavior the default in these software packages. The test 2070 was added to verify this behavior, adapted from 310. Based-on-work-by: georgeok <giorgos.n.oikonomou@gmail.com> Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Closes https://github.com/curl/curl/pull/4981
* curl: error on --alt-svc use w/o supportDaniel Stenberg2020-02-051-1/+4
| | | | | | | | Make the tool check for alt-svc support at run-time and return error accordingly if not present when the option is used. Reported-by: Harry Sintonen Closes #4878
* curl: avoid using strlen for testing if a string is emptyOrgad Shaneh2020-02-041-1/+1
| | | | Closes #4873
* smtp: Allow RCPT TO command to fail for some recipientsPavel Volgarev2020-01-211-0/+4
| | | | | | | | Introduces CURLOPT_MAIL_RCPT_ALLLOWFAILS. Verified with the new tests 3002-3007 Closes #4816
* curl:getparameter return error for --http3 if libcurl doesn't supportDaniel Stenberg2020-01-051-2/+5
| | | | Closes #4785
* tool: make a few char pointers point to const char insteadMarcel Raad2019-12-311-2/+1
| | | | | | These are read-only. Closes https://github.com/curl/curl/pull/4771
* build: Disable Visual Studio warning "conditional expression is constant"Jay Satiro2019-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Disable warning C4127 "conditional expression is constant" globally in curl_setup.h for when building with Microsoft's compiler. This mainly affects building with the Visual Studio project files found in the projects dir. Prior to this change the cmake and winbuild build systems already disabled 4127 globally for when building with Microsoft's compiler. Also, 4127 was already disabled for all build systems in the limited circumstance of the WHILE_FALSE macro which disabled the warning specifically for while(0). This commit removes the WHILE_FALSE macro and all other cruft in favor of disabling globally in curl_setup. Background: We have various macros that cause 0 or 1 to be evaluated, which would cause warning C4127 in Visual Studio. For example this causes it: #define Curl_resolver_asynch() 1 Full behavior is not clearly defined and inconsistent across versions. However it is documented that since VS 2015 Update 3 Microsoft has addressed this somewhat but not entirely, not warning on while(true) for example. Prior to this change some C4127 warnings occurred when I built with Visual Studio using the generated projects in the projects dir. Closes https://github.com/curl/curl/pull/4658
* curl: two new command line options for etagsMaros Priputen2019-11-281-0/+10
| | | | | | | | --etag-compare and --etag-save Suggested-by: Paul Hoffman Fixes #4277 Closes #4543
* curl: add --parallel-immediateDaniel Stenberg2019-11-211-0/+4
| | | | | | | | | | | | | | | Starting with this change when doing parallel transfers, without this option set, curl will prefer to create new transfers multiplexed on an existing connection rather than creating a brand new one. --parallel-immediate can be set to tell curl to prefer to use new connections rather than to wait and try to multiplex. libcurl-wise, this means that curl will set CURLOPT_PIPEWAIT by default on parallel transfers. Suggested-by: Tom van der Woerdt Closes #4500
* curl: --no-progress-meterDaniel Stenberg2019-10-081-5/+11
| | | | | | | | | New option that allows a user to ONLY switch off curl's progress meter and leave everything else in "talkative" mode. Reported-by: Piotr Komborski Fixes #4422 Closes #4470
* tool_getparam: remove duplicate switch caseDaniel Stenberg2019-09-201-5/+1
| | | | | Fixes warning detected by PVS-Studio Fixes #4374
* CURLOPT_HTTP_VERSION: seting this to 3 forces HTTP/3 use directlyDaniel Stenberg2019-08-081-4/+4
| | | | | | | | | | | | Even though it cannot fall-back to a lower HTTP version automatically. The safer way to upgrade remains via CURLOPT_ALTSVC. CURLOPT_H3 no longer has any bits that do anything and might be removed before we remove the experimental label. Updated the curl tool accordingly to use "--http3". Closes #4197
* curl: --sasl-authzid added to support CURLOPT_SASL_AUTHZID from the toolSteve Holme2019-08-061-1/+5
| | | | | | | | | | | | Ref: https://github.com/curl/curl/issues/3653 Ref: https://github.com/curl/curl/pull/3790 NOTE: This commit was cherry-picked and is part of a series of commits that added the authzid feature for upcoming 7.66.0. The series was temporarily reverted in db8ec1f so that it would not ship in a 7.65.x patch release. Closes https://github.com/curl/curl/pull/4186
* curl: cap the maximum allowed values for retry time argumentsDaniel Stenberg2019-07-301-2/+2
| | | | | | | | | | ... to avoid integer overflows later when multiplying with 1000 to convert seconds to milliseconds. Added test 1269 to verify. Reported-by: Jason Lee Closes #4166
* HTTP3: initial (experimental) supportDaniel Stenberg2019-07-211-1/+6
| | | | | | | | | USe configure --with-ngtcp2 or --with-quiche Using either option will enable a HTTP3 build. Co-authored-by: Alessandro Ghedini <alessandro@ghedini.me> Closes #3500
* curl: support parallel transfersDaniel Stenberg2019-07-201-21/+36
| | | | | | | | This is done by making sure each individual transfer is first added to a linked list as then they can be performed serially, or at will, in parallel. Closes #3804
* Revert all SASL authzid (new feature) commitsJay Satiro2019-05-251-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Revert all commits related to the SASL authzid feature since the next release will be a patch release, 7.65.1. Prior to this change CURLOPT_SASL_AUTHZID / --sasl-authzid was destined for the next release, assuming it would be a feature release 7.66.0. However instead the next release will be a patch release, 7.65.1 and will not contain any new features. After the patch release after the reverted commits can be restored by using cherry-pick: git cherry-pick a14d72c a9499ff 8c1cc36 c2a8d52 0edf690 Details for all reverted commits: Revert "os400: take care of CURLOPT_SASL_AUTHZID in curl_easy_setopt_ccsid()." This reverts commit 0edf6907ae37e2020722e6f61229d8ec64095b0a. Revert "tests: Fix the line endings for the SASL alt-auth tests" This reverts commit c2a8d52a1356a722ff9f4aeb983cd4eaf80ef221. Revert "examples: Added SASL PLAIN authorisation identity (authzid) examples" This reverts commit 8c1cc369d0c7163c6dcc91fd38edfea1f509ae75. Revert "curl: --sasl-authzid added to support CURLOPT_SASL_AUTHZID from the tool" This reverts commit a9499ff136d89987af885e2d7dff0a066a3e5817. Revert "sasl: Implement SASL authorisation identity via CURLOPT_SASL_AUTHZID" This reverts commit a14d72ca2fec5d4eb5a043936e4f7ce08015c177.
* curl: --sasl-authzid added to support CURLOPT_SASL_AUTHZID from the toolSteve Holme2019-05-221-1/+5
|
* curl: report error for "--no-" on non-boolean optionsDaniel Stenberg2019-05-201-0/+5
| | | | | | Reported-by: Olen Andoni Fixes #3906 Closes #3907
* alt-svc: the curl command line bitsDaniel Stenberg2019-03-031-9/+16
|
* cli tool: fix mime post with --disable-libcurl-option configure optionPatrick Monnerat2019-02-191-2/+2
| | | | | | Reported-by: Marcel Raad Fixes #3576 Closes #3583
* http: added options for allowing HTTP/0.9 responsesDaniel Stenberg2018-12-211-0/+5
| | | | | | | | | | | | Added CURLOPT_HTTP09_ALLOWED and --http0.9 for this purpose. For now, both the tool and library allow HTTP/0.9 by default. docs/DEPRECATE.md lays out the plan for when to reverse that default: 6 months after the 7.64.0 release. The options are added already now so that applications/scripts can start using them already now. Fixes #2873 Closes #3383
* curl: fix memory leak reading --writeout from fileDaniel Stenberg2018-11-301-0/+1
| | | | | | | | | If another string had been set first, the writout function for reading the syntax from file would leak the previously allocated memory. Reported-by: Brian Carpenter Fixes #3322 Closes #3330
* snprintf: renamed and we now only use msnprintf()Daniel Stenberg2018-11-231-2/+2
| | | | | | | | | | | The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
* curl: --local-port range was not "including"Daniel Stenberg2018-11-091-1/+1
| | | | | | | | | The end port number in a given range was not included in the range used, as it is documented to be. Reported-by: infinnovation-dev on github Fixes #3251 Closes #3255
* curl: --local-port fix followupDaniel Stenberg2018-11-081-1/+1
| | | | | | | | Regression by 52db54869e6. Reported-by: infinnovation-dev on github Fixes #3248 Closes #3249
* curl: fix --local-port integer overflowDaniel Stenberg2018-11-071-9/+22
| | | | | | | | | | The tool's local port command line range parser didn't check for integer overflows and could pass "weird" data to libcurl for this option. libcurl however, has a strict range check for the values so it rejects anything outside of the accepted range. Reported-by: Brian Carpenter Closes #3242
* tool_getparam: fix some commentsMichael Kaufmann2018-11-031-13/+5
|
* curl: --doh-url addedDaniel Stenberg2018-09-061-0/+4
|
* curl-compilers: enable -Wimplicit-fallthrough=4 for GCCMarcel Raad2018-08-211-1/+1
| | | | | | | | This enables level 4 instead of the default level 3, which of the currently used comments only allows /* FALLTHROUGH */ to silence the warning. Closes https://github.com/curl/curl/pull/2747
* curl: warn the user if a given file name looks like an optionDaniel Stenberg2018-08-151-23/+31
| | | | | | | | | | ... simply because this is usually a sign of the user having omitted the file name and the next option is instead "eaten" by the parser as a file name. Add test1268 to verify Closes #2885
* ssl: set engine implicitly when a PKCS#11 URI is providedAnderson Toshiyuki Sasaki2018-08-081-1/+1
| | | | | | | | | | | This allows the use of PKCS#11 URI for certificates and keys without setting the corresponding type as "ENG" and the engine as "pkcs11" explicitly. If a PKCS#11 URI is provided for certificate, key, proxy_certificate or proxy_key, the corresponding type is set as "ENG" if not provided and the engine is set to "pkcs11" if not provided. Acked-by: Nikos Mavrogiannopoulos Closes #2333
* curl: Fix segfault when -H @headerfile is emptyTobias Blomberg2018-07-281-1/+1
| | | | | | | The curl binary would crash if the -H command line option was given a filename to read using the @filename syntax but that file was empty. Closes #2797
* cppcheck: fix warningsMarian Klymov2018-06-111-4/+2
| | | | | | | | | | | | | - Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
* option: disallow username in URLBjörn Stenberg2018-05-311-0/+4
| | | | | | | Adds CURLOPT_DISALLOW_USERNAME_IN_URL and --disallow-username-in-url. Makes libcurl reject URLs with a username in them. Closes #2340
* setopt: add TLS 1.3 ciphersuitesDaniel Stenberg2018-05-291-0/+8
| | | | | | | | | | Adds CURLOPT_TLS13_CIPHERS and CURLOPT_PROXY_TLS13_CIPHERS. curl: added --tls13-ciphers and --proxy-tls13-ciphers Fixes #2435 Reported-by: zzq1015 on github Closes #2607