]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 years agotest412/413: verify alt-svc with trailing dots
Daniel Stenberg [Mon, 9 May 2022 07:39:22 +0000 (09:39 +0200)] 
test412/413: verify alt-svc with trailing dots

3 years agoaltsvc: fix host name matching for trailing dots
Daniel Stenberg [Mon, 9 May 2022 07:39:15 +0000 (09:39 +0200)] 
altsvc: fix host name matching for trailing dots

Closes #8819

3 years agohyper: fix test 357
Garrett Squire [Sat, 7 May 2022 00:34:14 +0000 (17:34 -0700)] 
hyper: fix test 357

This change fixes the hyper API such that PUT requests that receive a
417 response can retry without the Expect header.

Closes #8811

3 years agosectransp: bail out if SSLSetPeerDomainName fails
Harry Sintonen [Fri, 6 May 2022 14:25:19 +0000 (16:25 +0200)] 
sectransp: bail out if SSLSetPeerDomainName fails

Before the code would just warn about SSLSetPeerDomainName() errors.

Closes #8798

3 years agohttp_proxy/hyper: handle closed connections
Daniel Stenberg [Fri, 6 May 2022 08:00:24 +0000 (10:00 +0200)] 
http_proxy/hyper: handle closed connections

Enable test 1021 for hyper builds.

Patched-by: Prithvi MK
Fixes #8700
Closes #8806

3 years agoKNOWN_BUGS: timeout when reusing a http3 connection
Daniel Stenberg [Fri, 6 May 2022 07:20:18 +0000 (09:20 +0200)] 
KNOWN_BUGS: timeout when reusing a http3 connection

Closes #8764

3 years agoKNOWN_BUGS: configure --with-ca-fallback is not supported by h3
Daniel Stenberg [Fri, 6 May 2022 07:15:46 +0000 (09:15 +0200)] 
KNOWN_BUGS: configure --with-ca-fallback is not supported by h3

Closes #8696

3 years agoMakefile: fix "make ca-firefox"
Ryan Schmidt [Thu, 5 May 2022 13:43:52 +0000 (08:43 -0500)] 
Makefile: fix "make ca-firefox"

Closes #8804

3 years agotests: fix markdown formatting in README
Daniel Gustafsson [Thu, 5 May 2022 14:43:38 +0000 (16:43 +0200)] 
tests: fix markdown formatting in README

The asterisk in the abbreviation *NIX (for UNIX/Linux) needs to be
escaped to not mean start of italic formatting. This is consistent
with docs/RELEASE-PROCEDURE.md.

Closes: #8802
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agoTODO: expand on "Expose tried IP addresses that failed"
Daniel Stenberg [Thu, 5 May 2022 11:56:50 +0000 (13:56 +0200)] 
TODO: expand on "Expose tried IP addresses that failed"

Ref: #8794

3 years agotests/server: declare variable 'reqlogfile' static
Fabian Keil [Thu, 5 May 2022 09:53:08 +0000 (11:53 +0200)] 
tests/server: declare variable 'reqlogfile' static

Silences the warning:

     CC       socksd-socksd.o
   socksd.c:143:13: warning: no previous extern declaration for
    non-static variable 'reqlogfile' [-Wmissing-variable-declarations]
   const char *reqlogfile = DEFAULT_REQFILE;
               ^
   socksd.c:143:7: note: declare 'static' if the variable is not
    intended to be used outside of this translation unit
   const char *reqlogfile = DEFAULT_REQFILE;
         ^
   1 warning generated.

... when compiling with clang 13.

Closes: #8799
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
3 years agoHTTP-COOKIES: add missing CURLOPT_COOKIESESSION
Daniel Gustafsson [Thu, 5 May 2022 09:51:07 +0000 (11:51 +0200)] 
HTTP-COOKIES: add missing CURLOPT_COOKIESESSION

Commit 980a47b42 added support for ignoring session cookies, but it
was never added to the documentation.

Closes: #8795
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agodocs/THANKS: remove name duplicate
Daniel Stenberg [Thu, 5 May 2022 08:25:56 +0000 (10:25 +0200)] 
docs/THANKS: remove name duplicate

3 years ago.mailmap: update
Philip H [Thu, 5 May 2022 08:03:33 +0000 (10:03 +0200)] 
.mailmap: update

Closes #8800

3 years agombedtls: fix some error messages
Jay Satiro [Thu, 5 May 2022 07:13:24 +0000 (03:13 -0400)] 
mbedtls: fix some error messages

Prior to this change some of the error messages misidentified the
function that failed.

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 5 May 2022 06:48:17 +0000 (08:48 +0200)] 
RELEASE-NOTES: synced

3 years agox509asn1: make do_pubkey handle EC public keys
Sergey Markelov [Thu, 5 May 2022 06:44:21 +0000 (08:44 +0200)] 
x509asn1: make do_pubkey handle EC public keys

Closes #8757

3 years agombedtls: bail out if rng init fails
Harry Sintonen [Wed, 4 May 2022 23:23:16 +0000 (02:23 +0300)] 
mbedtls: bail out if rng init fails

There was a failf() call but no actual error return.

Closes #8796

3 years agourlapi: address (harmless) UndefinedBehavior sanitizer warning
Sergey Markelov [Thu, 5 May 2022 00:22:19 +0000 (17:22 -0700)] 
urlapi: address (harmless) UndefinedBehavior sanitizer warning

`while(i--)` causes runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'size_t' (aka 'unsigned long')

Closes #8797

3 years agotest{898,974,976}: add 'HTTP proxy' keywords
Fabian Keil [Mon, 25 Apr 2022 12:08:15 +0000 (14:08 +0200)] 
test{898,974,976}: add 'HTTP proxy' keywords

... so the tests can be automatically skipped when
testing external HTTP proxies like Privoxy.

Closes #8791

3 years agogskit_connect_step1: fixed bogus setsockopt calls
Harry Sintonen [Wed, 4 May 2022 21:33:17 +0000 (23:33 +0200)] 
gskit_connect_step1: fixed bogus setsockopt calls

setsockopt takes a reference to value, not value. With the current
code this just leads to -1 return value with errno EFAULT.

Closes #8793

3 years agoCURLOPT_SSH_AUTH_TYPES.3: fix the default
Daniel Stenberg [Wed, 4 May 2022 21:31:24 +0000 (23:31 +0200)] 
CURLOPT_SSH_AUTH_TYPES.3: fix the default

The default is all possible methods.

Closes #8792

3 years agoCURLOPT_DOH_URL.3: mention the known bug
Daniel Stenberg [Wed, 4 May 2022 12:44:14 +0000 (14:44 +0200)] 
CURLOPT_DOH_URL.3: mention the known bug

It is mostly duplicating info from KNOWN_BUGS but make it easier to find
for users of this option.

Closes #8790

3 years agoCURLOPT_HSTS*FUNCTION.3: document the involved structs as well
Daniel Stenberg [Tue, 3 May 2022 11:49:43 +0000 (13:49 +0200)] 
CURLOPT_HSTS*FUNCTION.3: document the involved structs as well

Reviewed-By: Daniel Gustafsson
Closes #8788

3 years agodocs/SECURITY-PROCESS.md: "Visible command line arguments"
Daniel Stenberg [Tue, 3 May 2022 11:37:04 +0000 (13:37 +0200)] 
docs/SECURITY-PROCESS.md: "Visible command line arguments"

3 years agoSECURITY-PROCESS: mention "URL inconsistencies"
Daniel Stenberg [Tue, 3 May 2022 06:50:10 +0000 (08:50 +0200)] 
SECURITY-PROCESS: mention "URL inconsistencies"

... as common problems that are *not* vulns.

3 years agocontributors: strip off final comma
Daniel Gustafsson [Mon, 2 May 2022 20:45:09 +0000 (22:45 +0200)] 
contributors: strip off final comma

The final row of contributors should not end with a comma as it's the
end of the list.

Closes: #8785
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agomisc: use "autoreconf -fi" instead buildconf
Philip H [Mon, 2 May 2022 15:52:16 +0000 (17:52 +0200)] 
misc: use "autoreconf -fi" instead buildconf

Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Closes #8777

3 years agocirrus: Use pip for Python packages on FreeBSD
Philip H [Mon, 2 May 2022 12:39:33 +0000 (14:39 +0200)] 
cirrus: Use pip for Python packages on FreeBSD

Using pip instead of easy_install is more in line with how other
CI images are being maintained.

Closes: #8783
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
3 years agocirrus: Update to FreeBSD 12.3
Philip H [Mon, 2 May 2022 12:38:45 +0000 (14:38 +0200)] 
cirrus: Update to FreeBSD 12.3

Closes: #8783
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
3 years agotool_getparam: simplify conditional statement
Daniel Gustafsson [Mon, 2 May 2022 12:04:59 +0000 (14:04 +0200)] 
tool_getparam: simplify conditional statement

param_place cannot be NULL here since we immediately efter this block
perform arithmetic on it (and use it in order to get here) so there is
little reason to check.

Closes: #8786
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agoRELEASE-NOTES: synced
Daniel Gustafsson [Sun, 1 May 2022 21:06:53 +0000 (23:06 +0200)] 
RELEASE-NOTES: synced

3 years agogskit: remove unused function set_callback
Daniel Gustafsson [Sun, 1 May 2022 20:59:25 +0000 (22:59 +0200)] 
gskit: remove unused function set_callback

This function has been unused since the initial commit of the GSKit
backend in 0eba02fd4.  The motivation for the code was getting the
whole certificate chain: the only place where the latter is available
is as a callback parameter.  Unfortunately it is not possible to pass
a user pointer to this callback, which precludes the possibility to
associate the cert chain with a data/conn structure.

For further information, search for pgsk_cert_validation_callback on:
https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_71/apis/gsk_attribute_set_callback.htm

As the upstream library never added a parameter like that to the API,
we give up the wait and remove the dead code.

Closes: #8782
Reviewed-by: Patrick Monnerat <patrick@monnerat.net>
3 years agocurl: free resource in error path
Daniel Gustafsson [Sat, 30 Apr 2022 19:25:15 +0000 (21:25 +0200)] 
curl: free resource in error path

If the new filename cannot be generated due to memory pressure, free
the allocated aname on the way out to avoid a small leak.

Closes: #8770
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agocurl: guard against size_t wraparound in no-clobber code
Daniel Gustafsson [Sat, 30 Apr 2022 19:17:40 +0000 (21:17 +0200)] 
curl: guard against size_t wraparound in no-clobber code

When generating the new filename, make sure we aren't overflowing the
size_t limit when calculating the new length. This is mostly academic
but good code hygeine nonetheless.

Closes: #8771
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agogha: build msh3
Daniel Stenberg [Sat, 30 Apr 2022 09:33:00 +0000 (11:33 +0200)] 
gha: build msh3

Closes #8779

3 years agoscripts/cijobs.pl: try "current branch" first then "master"
Daniel Stenberg [Sat, 30 Apr 2022 09:33:00 +0000 (11:33 +0200)] 
scripts/cijobs.pl: try "current branch" first then "master"

3 years agomsh3: get msh3 version from MsH3Version
Yusuke Nakamura [Sat, 30 Apr 2022 08:51:22 +0000 (10:51 +0200)] 
msh3: get msh3 version from MsH3Version

Closes #8762

3 years agomsh3: psss remote_port to MsH3ConnectionOpen
Yusuke Nakamura [Sat, 30 Apr 2022 08:51:09 +0000 (10:51 +0200)] 
msh3: psss remote_port to MsH3ConnectionOpen

MsH3 supported additional "Port" parameter to connect not hosted on
443 port QUIC website.

* https://github.com/nibanks/msh3/releases/tag/v0.3.0
* https://github.com/nibanks/msh3/pull/37

Closes #8762

3 years agoopenssl: define HAVE_SSL_CTX_SET_EC_CURVES for libressl
Christian Weisgerber [Fri, 29 Apr 2022 21:02:45 +0000 (23:02 +0200)] 
openssl: define HAVE_SSL_CTX_SET_EC_CURVES for libressl

SSL_CTX_set1_curves_list() has been available since LibreSSL 2.5.3,
released five years ago.

Bug: https://curl.se/mail/lib-2022-04/0059.html
Closes #8773

3 years agohttp: move Curl_allow_auth_to_host()
Daniel Stenberg [Fri, 29 Apr 2022 20:56:47 +0000 (22:56 +0200)] 
http: move Curl_allow_auth_to_host()

It was mistakenly put within the CURL_DISABLE_HTTP_AUTH #ifdef

Reported-by: Michael Olbrich
Fixes #8772
Closes #8775

3 years agomsh3: print boolean value as text representation
Daniel Gustafsson [Fri, 29 Apr 2022 09:40:25 +0000 (11:40 +0200)] 
msh3: print boolean value as text representation

Print the boolean value as its string representation instead of with
%hhu which isn't a format we typically use.

Closes: #8763
Reviewed-by: Nick Banks <nibanks@microsoft.com>
3 years agodata/test376: set a proper name
Daniel Stenberg [Fri, 29 Apr 2022 07:50:33 +0000 (09:50 +0200)] 
data/test376: set a proper name

3 years agoGHA/mbedtls: enabled nghttp2 in the build
Daniel Stenberg [Thu, 28 Apr 2022 15:12:27 +0000 (17:12 +0200)] 
GHA/mbedtls: enabled nghttp2 in the build

Closes #8767

3 years agombedtls: fix compile when h2-enabled
Daniel Stenberg [Thu, 28 Apr 2022 15:11:50 +0000 (17:11 +0200)] 
mbedtls: fix compile when h2-enabled

Fixes #8766
Reported-by: LigH-de on github
Closes #8768

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 28 Apr 2022 07:51:26 +0000 (09:51 +0200)] 
RELEASE-NOTES: synced

bumped curlver to 7.83.1-dev

3 years agoSECURITY-PROCESS: extended
Daniel Stenberg [Wed, 27 Apr 2022 13:34:10 +0000 (15:34 +0200)] 
SECURITY-PROCESS: extended

Also clarify BUG-BOUNTY.md with IBB details.

Closes #8754

3 years agoconn: fix typo 'connnection' -> 'connection' in two function names
Adam Rosenfield [Wed, 27 Apr 2022 04:04:33 +0000 (00:04 -0400)] 
conn: fix typo 'connnection' -> 'connection' in two function names

Closes #8759

3 years agoRELEASE-NOTES: synced curl-7_83_0
Daniel Stenberg [Wed, 27 Apr 2022 06:11:01 +0000 (08:11 +0200)] 
RELEASE-NOTES: synced

The 7.83.0 release

3 years agodocs/THANKS: contributors from 7.83.0
Daniel Stenberg [Wed, 27 Apr 2022 06:11:01 +0000 (08:11 +0200)] 
docs/THANKS: contributors from 7.83.0

3 years agotest 898/974/976: require proxy to run
Daniel Stenberg [Tue, 26 Apr 2022 21:54:48 +0000 (23:54 +0200)] 
test 898/974/976: require proxy to run

Fixes #8755
Reported-by: Marc Hörsken
Closes #8756

3 years agognutls: don't leak the SRP credentials in redirects
Daniel Stenberg [Tue, 26 Apr 2022 05:46:19 +0000 (07:46 +0200)] 
gnutls: don't leak the SRP credentials in redirects

Follow-up to 620ea21410030 and 139a54ed0a172a

Reported-by: Harry Sintonen
Closes #8752

3 years agoCURLOPT*TLSAUTH: they only work with OpenSSL or GnuTLS
Daniel Stenberg [Mon, 25 Apr 2022 21:31:22 +0000 (23:31 +0200)] 
CURLOPT*TLSAUTH: they only work with OpenSSL or GnuTLS

Closes #8753

3 years agoopenssl: don't leak the SRP credentials in redirects either
Daniel Stenberg [Mon, 25 Apr 2022 15:59:15 +0000 (17:59 +0200)] 
openssl: don't leak the SRP credentials in redirects either

Follow-up to 620ea21410030

Reported-by: Harry Sintonen
Closes #8751

3 years agohyper: fix tests 580 and 581 for hyper
Liam Warfield [Thu, 14 Apr 2022 04:36:21 +0000 (22:36 -0600)] 
hyper: fix tests 580 and 581 for hyper

Hyper now has the ability to preserve header order. This commit adds a
few lines setting the connection options for this feature.

Related to issue #8617
Closes #8707

3 years agoconncache: remove name arg from Curl_conncache_find_bundle
Daniel Stenberg [Mon, 25 Apr 2022 14:25:42 +0000 (16:25 +0200)] 
conncache: remove name arg from Curl_conncache_find_bundle

To simplify, and also since the returned name is not the full actual
name used for the check. The port number and zone id is also involved,
so just showing the name is misleading.

Closes #8750

3 years agotests: verify the fix for CVE-2022-27774
Daniel Stenberg [Mon, 25 Apr 2022 14:24:33 +0000 (16:24 +0200)] 
tests: verify the fix for CVE-2022-27774

 - Test 973 redirects from HTTP to FTP, clear auth
 - Test 974 redirects from HTTP to HTTP different port, clear auth
 - Test 975 redirects from HTTP to FTP, permitted to keep auth
 - Test 976 redirects from HTTP to HTTP different port, permitted to keep
   auth

3 years agotransfer: redirects to other protocols or ports clear auth
Daniel Stenberg [Mon, 25 Apr 2022 14:24:33 +0000 (16:24 +0200)] 
transfer: redirects to other protocols or ports clear auth

... unless explicitly permitted.

Bug: https://curl.se/docs/CVE-2022-27774.html
Reported-by: Harry Sintonen
Closes #8748

3 years agoconnect: store "conn_remote_port" in the info struct
Daniel Stenberg [Mon, 25 Apr 2022 14:24:33 +0000 (16:24 +0200)] 
connect: store "conn_remote_port" in the info struct

To make it available after the connection ended.

3 years agocookie.d: clarify when cookies are always sent
Daniel Stenberg [Mon, 25 Apr 2022 11:05:47 +0000 (13:05 +0200)] 
cookie.d: clarify when cookies are always sent

3 years agotest898: verify the fix for CVE-2022-27776
Daniel Stenberg [Mon, 25 Apr 2022 11:05:47 +0000 (13:05 +0200)] 
test898: verify the fix for CVE-2022-27776

Do not pass on Authorization headers on redirects to another port

3 years agohttp: avoid auth/cookie on redirects same host diff port
Daniel Stenberg [Mon, 25 Apr 2022 11:05:40 +0000 (13:05 +0200)] 
http: avoid auth/cookie on redirects same host diff port

CVE-2022-27776

Reported-by: Harry Sintonen
Bug: https://curl.se/docs/CVE-2022-27776.html
Closes #8749

3 years agolibssh2: make the md5 comparison fail if wrong length
Daniel Stenberg [Mon, 25 Apr 2022 11:01:20 +0000 (13:01 +0200)] 
libssh2: make the md5 comparison fail if wrong length

Making it just skip the check unless exactly 32 is too brittle. Even if
the docs says it needs to be exactly 32, it is be safer to make the
comparison fail here instead.

Reported-by: Harry Sintonen
Bug: https://hackerone.com/reports/1549461
Closes #8745

3 years agoconncache: include the zone id in the "bundle" hashkey
Daniel Stenberg [Mon, 25 Apr 2022 09:48:00 +0000 (11:48 +0200)] 
conncache: include the zone id in the "bundle" hashkey

Make connections to two separate IPv6 zone ids create separate
connections.

Reported-by: Harry Sintonen
Bug: https://curl.se/docs/CVE-2022-27775.html
Closes #8747

3 years agourl: check sasl additional parameters for connection reuse.
Patrick Monnerat [Mon, 25 Apr 2022 09:44:05 +0000 (11:44 +0200)] 
url: check sasl additional parameters for connection reuse.

Also move static function safecmp() as non-static Curl_safecmp() since
its purpose is needed at several places.

Bug: https://curl.se/docs/CVE-2022-22576.html

CVE-2022-22576

Closes #8746

3 years agolibssh2: compare sha256 strings case sensitively
Daniel Stenberg [Mon, 25 Apr 2022 09:41:20 +0000 (11:41 +0200)] 
libssh2: compare sha256 strings case sensitively

Reported-by: Harry Sintonen
Bug: https://hackerone.com/reports/1549435
Closes #8744

3 years agotool_getparam: error out on missing -K file
Daniel Stenberg [Mon, 25 Apr 2022 09:38:37 +0000 (11:38 +0200)] 
tool_getparam: error out on missing -K file

Add test 411 to verify.

Reported-by: Median Median Stride
Bug: https://hackerone.com/reports/1542881
Closes #8731

3 years agongtcp2: deal with sub-millisecond timeout
Tatsuhiro Tsujikawa [Mon, 25 Apr 2022 09:37:17 +0000 (11:37 +0200)] 
ngtcp2: deal with sub-millisecond timeout

Closes #8738

3 years agomisc: update copyright year ranges
Daniel Stenberg [Mon, 25 Apr 2022 07:31:09 +0000 (09:31 +0200)] 
misc: update copyright year ranges

3 years agoc_escape: escape '?' in generated --libcurl code
Daniel Stenberg [Sun, 24 Apr 2022 22:29:22 +0000 (00:29 +0200)] 
c_escape: escape '?' in generated --libcurl code

In order to avoid the risk of it being used in an accidental trigraph in
the generated code.

Reported-by: Harry Sintonen
Bug: https://hackerone.com/reports/1548535
Closes #8742

3 years agomlc: curl.zuul.vexxhost.dev is reachable again
Philip H [Sun, 24 Apr 2022 21:29:38 +0000 (23:29 +0200)] 
mlc: curl.zuul.vexxhost.dev is reachable again

remove it from ignorelist for linkcheck

Closes #8736

3 years agongtcp2: avoid busy loop in low CWND situation
Tatsuhiro Tsujikawa [Sun, 24 Apr 2022 21:21:26 +0000 (23:21 +0200)] 
ngtcp2: avoid busy loop in low CWND situation

Closes #8739

3 years agoTODO: telnet - exit immediately upon connection if stdin is /dev/null
Daniel Stenberg [Sun, 24 Apr 2022 21:07:43 +0000 (23:07 +0200)] 
TODO: telnet - exit immediately upon connection if stdin is /dev/null

Suggested-by: Robin A. Meade
URL: https://curl.se/mail/archive-2022-04/0027.html

3 years agodocs: updates spellings with full words
Kushal Das [Thu, 21 Apr 2022 15:05:36 +0000 (17:05 +0200)] 
docs: updates spellings with full words

Closes #8730

3 years agotests/FILEFORMAT.md: spellfix
Daniel Stenberg [Thu, 21 Apr 2022 15:01:45 +0000 (17:01 +0200)] 
tests/FILEFORMAT.md: spellfix

3 years agomisc: fix typos
Daniel Gustafsson [Thu, 21 Apr 2022 07:43:35 +0000 (09:43 +0200)] 
misc: fix typos

Fix a few random typos is comments and workflow names.

3 years agomacos: fix .plist installation into framework
Daniel Gustafsson [Thu, 21 Apr 2022 07:28:52 +0000 (09:28 +0200)] 
macos: fix .plist installation into framework

The copy command introduced in e498a9b1f had leftover '>' from the
previous sed command it replaced, which broke its syntax.  Fix by
removing.

Reported-by: Emanuele Torre <torreemanuele6@gmail.com>
3 years agoMakefile: fix ca-bundle due to mk-ca-bundle.pl being moved
Christopher Degawa [Wed, 20 Apr 2022 16:52:42 +0000 (11:52 -0500)] 
Makefile: fix ca-bundle due to mk-ca-bundle.pl being moved

The script was moved in 8e22fc68e7dda43e9f but the lines that called it
was not changed to reflect it's new position

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Closes #8728

3 years agomacos: set .plist version in autoconf
Daniel Gustafsson [Wed, 20 Apr 2022 13:26:13 +0000 (15:26 +0200)] 
macos: set .plist version in autoconf

Set the libcurl version in libcurl.plist like how libcurl.vers is
created.

Closes: #8692
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Nick Zitzmann <nickzman@gmail.com>
3 years agocookies: Improve errorhandling for reading cookiefile
Daniel Gustafsson [Wed, 20 Apr 2022 12:17:29 +0000 (14:17 +0200)] 
cookies: Improve errorhandling for reading cookiefile

The existing programming had some issues with errorhandling for reading
the cookie file. If the file failed to open, we would silently ignore it
and continue as if there was no file (or stdin) passed. In this case, we
would also call fclose() on the NULL FILE pointer, which is undefined
behavior. Fix by ensuring that the FILE pointer is set before calling
fclose on it, and issue a warning in case the file cannot be opened.
Erroring out on nonexisting file would break backwards compatibility of
very old behavior so we can't really go there.

Closes: #8699
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
3 years agolibcurl-tutorial.3: spellfix and minor polish
Daniel Stenberg [Wed, 20 Apr 2022 08:56:41 +0000 (10:56 +0200)] 
libcurl-tutorial.3: spellfix and minor polish

3 years agoCURLINFO_PRIMARY_PORT.3: spellfix
Daniel Stenberg [Wed, 20 Apr 2022 08:46:23 +0000 (10:46 +0200)] 
CURLINFO_PRIMARY_PORT.3: spellfix

Reported-by: Patrick Monnerat
3 years agolibssh: fix double close
Jay Dommaschk [Wed, 20 Apr 2022 07:11:41 +0000 (09:11 +0200)] 
libssh: fix double close

libssh closes the socket in ssh_diconnect() so make sure that libcurl
does not also close it.

Fixes #8708
Closes #8718

3 years agounit1620: call global_init before calling Curl_open
Gisle Vanem [Mon, 18 Apr 2022 06:45:14 +0000 (02:45 -0400)] 
unit1620: call global_init before calling Curl_open

Curl_open calls the resolver init and on Windows if the resolver backend
is c-ares then the Windows sockets library (winsock) must already have
been initialized (via global init).

Ref: https://github.com/curl/curl/pull/8540#issuecomment-1059771800

Closes https://github.com/curl/curl/pull/8719

3 years agoCURLINFO_PRIMARY_PORT.3: clarify which port this is
Daniel Stenberg [Tue, 19 Apr 2022 21:06:12 +0000 (23:06 +0200)] 
CURLINFO_PRIMARY_PORT.3: clarify which port this is

As it was not entirely clear previously.

Closes #8725

3 years agoCURLOPT_UNRESTRICTED_AUTH.3: extended explanation
Daniel Stenberg [Tue, 19 Apr 2022 16:15:02 +0000 (18:15 +0200)] 
CURLOPT_UNRESTRICTED_AUTH.3: extended explanation

Include details about Authentication headers.

Reported-by: Brad Spencer
Fixes #8724
Closes #8726

3 years ago.github/workflows/macos.yml: add a libssh job with c-ares
Daniel Stenberg [Tue, 19 Apr 2022 14:31:00 +0000 (16:31 +0200)] 
.github/workflows/macos.yml: add a libssh job with c-ares

... to enable the memdebug system

Closes #8720

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 18 Apr 2022 08:27:55 +0000 (10:27 +0200)] 
RELEASE-NOTES: synced

3 years agodocs/HTTP3.md: fix typo
Gisle Vanem [Mon, 18 Apr 2022 03:44:18 +0000 (23:44 -0400)] 
docs/HTTP3.md: fix typo

also fix msh3 section formatting

Ref: https://github.com/curl/curl/commit/37492ebb#r70980087

3 years agotimediff.[ch]: add curlx helper functions for timeval conversions
Marc Hoersken [Sat, 29 Aug 2020 10:54:30 +0000 (12:54 +0200)] 
timediff.[ch]: add curlx helper functions for timeval conversions

Also move timediff_t definitions from timeval.h to timediff.h and
then make timeval.h include the new standalone-capable timediff.h.

Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Supersedes #5888
Closes #8595

3 years agotests: refactor server/socksd.c to support --unix-socket
Balakrishnan Balasubramanian [Sun, 17 Apr 2022 09:43:36 +0000 (11:43 +0200)] 
tests: refactor server/socksd.c to support --unix-socket

Closes #8687

3 years agotool_paramhlp: use feof(3) to identify EOF correctly when using fread(3)
Emanuele Torre [Sun, 17 Apr 2022 09:36:28 +0000 (11:36 +0200)] 
tool_paramhlp: use feof(3) to identify EOF correctly when using fread(3)

This loop was using the number of bytes read from the file as condition
to keep reading.

From Linux's fread(3) man page:
> On success, fread() and fwrite() return the number of items read or
> written. This number equals the number of bytes transferred only when
> size is 1. If an error occurs, or the end of the file is reached, the
> return value is a short item count (or zero).
>
> The file position indicator for the stream is advanced by the number
> of bytes successfully read or written.
>
> fread() does not distinguish between end-of-file and error, and
> callers must use feof(3) and ferror(3) to determine which occurred.

This means that nread!=0 doesn't make much sense as an end condition for
the loop: nread==0 doesn't necessarily mean that EOF has been reached or
an error has occured (but that is usually the case) and nread!=0 doesn't
necessarily mean that EOF has not been reached or that no read errors
have occured. feof(3) and ferror(3) should be uses when using fread(3).

Currently curl has to performs an extra fread(3) call to get a return
value equal to 0 to stop looping.

This usually "works" (even though nread==0 shouldn't be interpreted as
EOF) if stdin is a pipe because EOF usually marks the "real" end of the
stream, so the extra fread(3) call will return immediately and the extra
read syscall won't be noticeable:

    bash-5.1$ strace -e read curl -s -F file=@- 0x0.st <<< a 2>&1 |
    > tail -n 5
    read(0, "a\n", 4096)                    = 2
    read(0, "", 4096)                       = 0
    read(0, "", 4096)                       = 0
    http://0x0.st/oRs.txt
    +++ exited with 0 +++
    bash-5.1$

But this doesn't work if curl is reading from stdin, stdin is a
terminal, and the EOF is being emulated using a shell with ^D. Two
consecutive ^D will be required in this case to actually make curl stop
reading:

    bash-5.1$ curl -F file=@- 0x0.st
    a
    ^D^D
    http://0x0.st/oRs.txt
    bash-5.1$

A possible workaround to this issue is to use a program that handles EOF
correctly to indirectly send data to curl's stdin:

    bash-5.1$ cat - | curl -F file=@- 0x0.st
    a
    ^D
    http://0x0.st/oRs.txt
    bash-5.1$

This patch makes curl handle EOF properly when using fread(3) in
file2memory() so that the workaround is not necessary.

Since curl was previously ignoring read errors caused by this fread(3),
ferror(3) is also used in the condition of the loop: read errors and EOF
will have the same meaning; this is done to somewhat preserve the old
behaviour instead of making the command fail when a read error occurs.

Closes #8701

3 years agogen.pl: change wording for mutexed options
Daniel Stenberg [Sun, 17 Apr 2022 09:21:15 +0000 (11:21 +0200)] 
gen.pl: change wording for mutexed options

Instead of saying "This option overrides NNN", now say "This option is
mutually exclusive to NNN" in the generated man page ouput, as the
option does not in all cases actually override the others but they are
always mutually exclusive.

Ref: #8704
Closes #8716

3 years agocurl: error out if -T and -d are used for the same URL
Daniel Stenberg [Sun, 17 Apr 2022 09:18:16 +0000 (11:18 +0200)] 
curl: error out if -T and -d are used for the same URL

As one implies PUT and the other POST, both cannot be used
simultaneously.

Add test 378 to verify.

Reported-by: Boris Verkhovskiy
Fixes #8704
Closes #8715

3 years agolib: remove exclamation marks
Daniel Stenberg [Sat, 16 Apr 2022 09:55:05 +0000 (11:55 +0200)] 
lib: remove exclamation marks

... from infof() and failf() calls. Make them less attention seeking.

Closes #8713

3 years agofail.d: tweak the description
Daniel Stenberg [Fri, 15 Apr 2022 21:50:34 +0000 (23:50 +0200)] 
fail.d: tweak the description

Reviewed-by: Daniel Gustafsson
Suggested-by: Robert Charles Muir
Ref: https://twitter.com/rcmuir/status/1514915401574010887

Closes #8714

3 years agodocs: Fix missing semicolon in example code
Daniel Gustafsson [Fri, 15 Apr 2022 21:35:15 +0000 (23:35 +0200)] 
docs: Fix missing semicolon in example code

Multiple share examples were missing a semicolon on the line defining
the CURLSHcode variable.

Closes: #8697
Reported-by: Michael Kaufmann <mail@michael-kaufmann.ch>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agoinfof: consistent capitalization of warning messages
Daniel Gustafsson [Thu, 14 Apr 2022 19:13:29 +0000 (21:13 +0200)] 
infof: consistent capitalization of warning messages

Ensure that all infof calls with a warning message are capitalized
in the same way.  At some point we should probably set up a style-
guide for infof but until then let's aim for a little consistenncy
where we can.

Closes: #8711
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agoRELEASE-NOTES: synced
Daniel Gustafsson [Thu, 14 Apr 2022 12:12:17 +0000 (14:12 +0200)] 
RELEASE-NOTES: synced

3 years agoperl: removed a double semicolon at end of line
Matteo Baccan [Thu, 14 Apr 2022 11:06:32 +0000 (13:06 +0200)] 
perl: removed a double semicolon at end of line

Remove double semicolons at end of line in Perl code.

Closes: #8709
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>