summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* tool_operate: bail if set CURLOPT_HTTP09_ALLOWED returns errorDaniel Stenberg2021-03-111-0/+4
| | | | Closes #6727
* config: remove CURL_SIZEOF_CURL_OFF_T use only SIZEOF_CURL_OFF_TDaniel Stenberg2021-03-113-6/+6
| | | | | | | Make the code consistently use a single name for the size of the "curl_off_t" type. Closes #6702
* docs: add missing Arg tag to --stderrVladimir Varlamov2021-03-041-1/+1
| | | | | | | | | | | | | | | Prior to this change the required argument was not shown. curl.1 before: --stderr curl.1 after: --stderr <file> curl --help before: --stderr Where to redirect stderr curl --help after: --stderr <file> Where to redirect stderr Closes https://github.com/curl/curl/pull/6692
* tool_help: Increase space between option and descriptionJay Satiro2021-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Increase the minimum number of spaces between the option and the description from 1 to 2. Before: ~~~ -u, --user <user:password> Server user and password -A, --user-agent <name> Send User-Agent <name> to server -v, --verbose Make the operation more talkative -V, --version Show version number and quit -w, --write-out <format> Use output FORMAT after completion --xattr Store metadata in extended file attributes ~~~ After: ~~~ -u, --user <user:password> Server user and password -A, --user-agent <name> Send User-Agent <name> to server -v, --verbose Make the operation more talkative -V, --version Show version number and quit -w, --write-out <format> Use output FORMAT after completion --xattr Store metadata in extended file attributes ~~~ Closes https://github.com/curl/curl/pull/6674
* curl: set CURLOPT_NEW_FILE_PERMS if requestedDaniel Stenberg2021-02-271-0/+3
| | | | | | | | | | The --create-file-mode code logic accepted the value but never actually passed it on to libcurl! Follow-up to a7696c73436f (shipped in 7.75.0) Reported-by: Johannes Lesr Fixes #6657 Closes #6666
* tool_operate: check argc before accessing argv[1]Daniel Stenberg2021-02-271-1/+1
| | | | | | | Follow-up to 09363500b Reported-by: Emil Engler Reviewed-by: Daniel Gustafsson Closes #6668
* gnutls: Fix nettle discoveryDaniel Gustafsson2021-02-251-66/+2
| | | | | | | | | | | | | | | | | Commit e06fa7462ac258c removed support for libgcrypt leaving only support for nettle which has been the default crypto library in GnuTLS for a long time. There were however a few conditionals on USE_GNUTLS_NETTLE which cause compilation errors in the metalink code (as it used the gcrypt fallback instead as a result). See the below autobuild for an example of the error: https://curl.se/dev/log.cgi?id=20210225123226-30704#prob1 This removes all uses of USE_GNUTLS_NETTLE and also removes the gcrypt support from the metalink code while at it. Closes #6656 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* cookies: Support multiple -b parametersDaniel Gustafsson2021-02-254-10/+39
| | | | | | | | | | Previously only a single -b cookie parameter was supported with the last one winning. This adds support for supplying multiple -b params to have them serialized semicolon separated. Both cookiefiles and cookies can be entered multiple times. Closes #6649 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* http: add support to read and store the referrer headerViktor Szakats2021-02-193-5/+8
| | | | | | | | | - add CURLINFO_REFERER libcurl option - add --write-out '%{referer}' command-line option - extend --xattr command-line option to fill user.xdg.referrer.url extended attribute with the referrer (if there was any) Closes #6591
* http: do not add a referrer header with empty valueViktor Szakats2021-02-161-1/+2
| | | | | | | | | | Previously an empty 'Referer:' header was added to the HTTP request when passing `--referer ';auto'` or `--referer ''` on the command-line. This patch makes `--referer` work like `--header 'Referer:'` and will only add the header if it has a non-zero length value. Reviewed-by: Jay Satiro Closes #6610
* doh: add options to disable ssl verificationJay Satiro2021-02-144-3/+30
| | | | | | | | | | | | | | | | | | | | | | - New libcurl options CURLOPT_DOH_SSL_VERIFYHOST, CURLOPT_DOH_SSL_VERIFYPEER and CURLOPT_DOH_SSL_VERIFYSTATUS do the same as their respective counterparts. - New curl tool options --doh-insecure and --doh-cert-status do the same as their respective counterparts. Prior to this change DOH SSL certificate verification settings for verifyhost and verifypeer were supposed to be inherited respectively from CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER, but due to a bug were not. As a result DOH verification remained at the default, ie enabled, and it was not possible to disable. This commit changes behavior so that the DOH verification settings are independent and not inherited. Ref: https://github.com/curl/curl/pull/4579#issuecomment-554723676 Fixes https://github.com/curl/curl/issues/4578 Closes https://github.com/curl/curl/pull/6597
* curl: provide libgsasl version and feature info in -V outputDaniel Stenberg2021-02-111-0/+1
| | | | Closes #6592
* curl: add --fail-with-bodyDaniel Stenberg2021-02-114-8/+29
| | | | | | | | Prevent both --fail and --fail-with-body on the same command line. Verify with test 349, 360 and 361. Closes #6449
* tool_help: add missing argument for --create-file-modeJay Satiro2021-02-101-2/+2
| | | | | | | | | | | | | | Prior to this change the required argument was not shown in curl --help. before: --create-file-mode File mode for created files after: --create-file-mode <mode> File mode (octal) for created files Reported-by: ZimCodes@users.noreply.github.com Fixes https://github.com/curl/curl/issues/6590
* Makefile.m32: add support for libgsasl dependencyViktor Szakats2021-02-101-0/+11
| | | | | Reviewed-by: Marcel Raad Closes #6586
* tool_paramhlp: reduce variable scopeMarcel Raad2021-02-101-1/+2
| | | | Closes https://github.com/curl/curl/pull/6576
* tool_writeout: refactor write-out and write-out jsonJay Satiro2021-02-095-414/+303
| | | | | | | | | | | | | | | | | | | | | - Deduplicate the logic used by write-out and write-out json. Rather than have separate writeLong, writeString, etc, logic for each of write-out and write-out json instead have respective shared functions that can output either format and a 'use_json' parameter to indicate whether it is json that is output. This will make it easier to maintain. Rather than have to go through two sets of logic now we only have to go through one. - Support write-out %{errormsg} and %{exitcode} in json. - Clarify in the doc that %{exitcode} is the exit code of the transfer. Prior to this change it just said "The numerical exitcode" which implies it's the exit code of the tool, and it's not necessarily that. Closes https://github.com/curl/curl/pull/6544
* copyright: fix year ranges in need of updatesDaniel Stenberg2021-02-032-2/+2
|
* http: improve AWS HTTP v4 Signature authDmitry Wagin2021-01-305-6/+7
| | | | | | | | | | | | | | | | | | - Add support services without region and service prefixes in the URL endpoint (ex. Min.IO, GCP, Yandex Cloud, Mail.Ru Cloud Solutions, etc) by providing region and service parameters via aws-sigv4 option. - Add [:region[:service]] suffix to aws-sigv4 option; - Fix memory allocation errors. - Refactor memory management. - Use Curl_http_method instead() STRING_CUSTOMREQUEST. - Refactor canonical headers generating. - Remove repeated sha256_to_hex() usage. - Add some docs fixes. - Add some codestyle fixes. - Add overloaded strndup() for debug - curl_dbg_strndup(). - Update tests. Closes #6524
* copyright: fix missing year (range) updatesDaniel Stenberg2021-01-293-3/+3
|
* tool_writeout: make %{errormsg} blank for no errorsDaniel Stenberg2021-01-281-3/+4
| | | | Closes #6539
* build: fix djgpp buildsGisle Vanem2021-01-271-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Update build instructions in packages/DOS/README - Extend 'VPATH' with 'vquic' and 'vssh'. - Allow 'Makefile.dist' to build both 'lib' and 'src'. - Allow using the Windows hosted djgpp cross compiler to build for MSDOS under Windows. - 'USE_SSL' -> 'USE_OPENSSL' - Added a 'link_EXE' macro. Etc, etc. - Linking 'curl.exe' needs '$(CURLX_CFILES)' too. - Do not pick-up '../lib/djgpp/*.o' files. Recompile locally. - Generate a gzipped 'tool_hugehelp.c' if 'USE_ZLIB=1'. - Remove 'djgpp-clean' - Adapt to new C-ares directory structure - Use conditional variable assignments Clarify the 'conditional variable assignment' in 'common.dj'. Closes https://github.com/curl/curl/pull/6382
* curl: include the file name in --xattr/--remote-time error msgsDaniel Stenberg2021-01-272-4/+4
|
* curl: s/config->global/global/ in single_transfer()Daniel Stenberg2021-01-271-11/+11
|
* curl: move fprintf outputs to warnfDaniel Stenberg2021-01-274-47/+41
| | | | | | | | | For setting and getting time of the download. To make the outputs respect --silent etc. Reported-by: Viktor Szakats Fixes #6533 Closes #6535
* tool_operate: spellfix a commentDaniel Stenberg2021-01-141-1/+1
|
* tool_doswin: Restore original console settings on CTRL signalJay Satiro2021-01-122-53/+66
| | | | | | | | | | | | | | | | | | - Move Windows terminal init code from tool_main to tool_doswin. - Restore the original console settings on CTRL+C and CTRL+BREAK. Background: On Windows the curl tool changes the console settings to enable virtual terminal processing (eg color output) if supported (ie Win 10). The original settings are restored on exit but prior to this change were not restored in the case of the CTRL signals. Windows VT behavior varies depending on console/powershell/terminal; refer to the discussion in #6226. Assisted-by: Rich Turner Closes https://github.com/curl/curl/pull/6226
* help: update to current codebaseEmil Engler2021-01-121-5/+6
| | | | | | This commit bumps the help to the current state of the project. Closes #6437
* curl.h: add CURLPROTO_GOPHERS as own protocol identifierDaniel Stenberg2021-01-061-1/+4
| | | | | | | Follow-up to a1f06f32b860, to make sure it can be handled separately from plain gopher. Closes #6418
* tool_operate: fix the suppression logic of some error messagesJay Satiro2021-01-041-6/+8
| | | | | | | | | | | | | | | | | | | | | | - Fix the failed truncation and failed writing body error messages to not be shown unless error messages are shown. (ie the user has specified -sS, or has not specified -s). - Also prefix same error messages with "curl: ", for example: curl: (23) Failed to truncate, exiting Prior to this change the failed truncation error messages would be shown if not -s, but did not account for -sS which should show. Prior to this change the failed writing body error messages would be shown always. Ref: https://curl.se/docs/manpage.html#-S Bug: https://curl.se/mail/archive-2020-12/0017.html Reported-by: Hongyi Zhao Closes https://github.com/curl/curl/pull/6402
* language: s/behaviour/behavior/gEmil Engler2021-01-022-4/+4
| | | | | | | | We currently use both spellings the british "behaviour" and the american "behavior". However "behavior" is more used in the project so I think it's worth dropping the british name. Closes #6395
* docs/examples: adjust prototypes for CURLOPT_READFUNCTIONOlaf Hering2020-12-302-2/+2
| | | | | | | The type of the buffer in curl_read_callback is 'char *', not 'void *'. Signed-off-by: Olaf Hering <olaf@aepfle.de> Closes #6392
* tool_operate: avoid NULL dereference of first_argDaniel Stenberg2020-12-261-1/+1
| | | | | | | Follow-up to 6a5e020d4d2b04a Identified by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28999 Closes #6377
* misc: fix "warning: empty expression statement has no effect"Daniel Stenberg2020-12-263-18/+18
| | | | | | | | | | Turned several macros into do-while(0) style to allow their use to work find with semicolon. Bug: https://github.com/curl/curl/commit/08e8455dddc5e48e58a12ade3815c01ae3da3b64#commitcomment-45433279 Follow-up to 08e8455dddc5e4 Reported-by: Gisle Vanem Closes #6376
* writeout: fix NULL dereference for "this url"Daniel Stenberg2020-12-261-1/+2
| | | | | | | | Detected by torture test 1029 Follow-up to 7a90ddf88f5a Closes #6374
* curl: fix handling of -q optionCherish982020-12-231-1/+1
| | | | | | | | The match of the "-q" option (short for "--disable") should: a) allow concatenation with other single-letters; and b) be case-sensitive, lest confusing with "-Q" ("--quote") Closes #6364
* curl: add variables to --write-outDaniel Stenberg2020-12-216-104/+112
| | | | | | | | | | | | | | | | | | | | | In particular, these ones can help a user to create its own error message when one or transfers fail. writeout: add 'onerror', 'url', 'urlnum', 'exitcode', 'errormsg' onerror - lets a user only show the rest on non-zero exit codes url - the input URL used for this transfer urlnum - the numerical URL counter (0 indexed) for this transfer exitcode - the numerical exit code for the transfer errormsg - obvious Reported-by: Earnestly on github Fixes #6199 Closes #6207
* tool: add AWS HTTP v4 Signature supportMatthias Gatto2020-12-215-0/+12
| | | | Signed-off-by: Matthias Gatto <matthias.gatto@outscale.com>
* curl: add --create-file-mode [mode]Daniel Stenberg2020-12-215-4/+33
| | | | | | | | This option sets the (octal) mode to use for the remote file when one is created, using the SFTP, SCP or FILE protocols. When not set, the default is 0644. Closes #6244
* tool_setopt: provide helper output in debug buildsDaniel Stenberg2020-12-181-1/+6
| | | | ... for when setopt() returns error.
* tooĺ_writeout: fix the -w time output unitsDaniel Stenberg2020-12-151-7/+15
| | | | | | | | | Fix regression from commit fc813f80e1bcac (#6248) that changed the unit to microseconds instead of seconds with fractions Reported-by: 不确定 Fixes #6321 Closes #6322
* ftp: CURLOPT_FTP_SKIP_PASV_IP by defaultDaniel Stenberg2020-12-071-0/+1
| | | | | | | | | | | | The command line tool also independently sets --ftp-skip-pasv-ip by default. Ten test cases updated to adapt the modified --libcurl output. Bug: https://curl.se/docs/CVE-2020-8284.html CVE-2020-8284 Reported-by: Varnavas Papaioannou
* tool_writeout: use off_t getinfo-types instead of doublesDaniel Stenberg2020-11-261-30/+29
| | | | | | | | Commit 3b80d3ca46b12e52342 (June 2017) introduced getinfo replacement variables that use curl_off_t instead of doubles. Switch the --write-out function over to use them. Closes #6248
* infof/failf calls: fix format specifiersRikard Falkeborn2020-11-241-2/+2
| | | | | | Update a few format specifiers to match what is being printed. Closes #6241
* Makefile.m32: add support for UNICODE buildsViktor Szakats2020-11-231-0/+7
| | | | | | | | | | | | | It requires the linker to support the `-municode` option. This is available in more recent mingw-w64 releases. Ref: https://gcc.gnu.org/onlinedocs/gcc/x86-Windows-Options.html Ref: https://stackoverflow.com/questions/3571250/wwinmain-unicode-and-mingw/11706847#11706847 Reviewed-by: Jay Satiro Reviewed-by: Marcel Raad Closes #6228
* curl: add compatibility for Amiga and GCC 6.5Oliver Urbann2020-11-201-0/+1
| | | | | | | Changes are mainly reordering and adding of includes required to compile with a more recent version of GCC. Closes #6220
* curl: only warn not fail, if not finding the home dirDaniel Stenberg2020-11-131-20/+15
| | | | | | | | ... as there's no good reason to error out completely. Reported-by: Andreas Fischer Fixes #6200 Closes #6201
* tool_operate: set HSTS with CURLOPT_HSTS to pass on filenameDaniel Stenberg2020-11-061-1/+1
| | | | Closes #6175
* copyright: fix year rangesDaniel Stenberg2020-11-0540-40/+40
| | | | Follow-up from 4d2f8006777
* curl.se: new homeDaniel Stenberg2020-11-0494-99/+99
| | | | Closes #6172