Commit graph

36575 commits

Author SHA1 Message Date
Viktor Szakats
38c19edd67
cmake: say 'absolute path' in option descriptions and docs
To not have to guess. Also to sync with autotools, which already uses
this wording.

Also:
- replace the stray term 'folder' with 'directory' for consistency.
- store help text in a temp variable to avoid overly long strings
  (mandatory in CMake <4.2.0 and can't be trivially split), also
  to avoid repeating this string 4 times.

Ref: https://cmake.org/cmake/help/v4.2/command/set.html

Closes #19169
2025-10-21 15:07:36 +02:00
Viktor Szakats
1966c86d71
cmake: add and use local FindGnuTLS module
Replacing a combination of custom logic in the main script and relying
on CMake's built-in Find module, with code and behavior used for
the rest of dependencies.

Also to:
- add version detection in the non-pkg-config path.
- make `GNUTLS_INCLUDE_DIR` and `GNUTLS_LIBRARY` take precedence over
  pkg-config. As with other dependencies.
- document the above two configuration options.
- prepare for #16973, which originally introduced this local Find
  module.

The local module is doing largely the same as CMake's built-in
FindGnuTLS. Differences:
- honors `CURL_USE_PKGCONFIG`.
- returns GnuTLS version for non-pkg-config detection.
- consistently returns `GNUTLS_VERSION`.
  (CMake's built-in uses s different name in <3.16.)
- CMake 3.16+ returns an imported target. curl supports 3.7,
  therefore we may only use it conditionally, which isn't worth it.

Cherry-picked from #16973

Closes #19163
2025-10-21 14:37:40 +02:00
Daniel Stenberg
9e198618de
tool_parsecfg: detect and error on recursive --config use
The config file parser now has a maximum level of inclusions allowed (5)
to detect and prevent recursive inclusions of itself leading to badness.

Bonus: clean up return code handling from the config parser.

Test 774 verifies
Closes #19168
2025-10-21 10:11:43 +02:00
Viktor Szakats
b4f57c8045
cmake: inline linter instructions
To avoid it applying to all the rest of the script.

Follow-up to b761eb5add #17576

Closes #19172
2025-10-21 01:53:35 +02:00
Viktor Szakats
1afdb65b55
INSTALL-CMAKE.md: fix descriptions for LDAP dependency options
After introducing the local FindLDAP module, these options work the same
way as with other dependencies.

Follow-up to 49f2a23d50 #15273

Closes #19170
2025-10-21 01:08:05 +02:00
Viktor Szakats
921ff01263
cmake: two minor tidy-ups
- flatten an if tree.
- fix a typo in comment.

Closes #19171
2025-10-21 01:08:04 +02:00
Stefan Eissing
dbff3eec45
cf-socket: give information when unable to open socket
Give ERRNO explanation in a failf() when unable to open a socket.
Helps in finding out what the issue preventing your curl to work
really is. Just had a wrong ulimit after a sys update.

Closes #19158
2025-10-20 15:21:47 +02:00
Stefan Eissing
4be9db7bc8
http: accept duplicate location with same value
When a server sends a Location: header repeat with the same location,
ignore the repeats silently.

Follow-up to 9596c4a258
Closes #19159
2025-10-20 14:48:20 +02:00
Viktor Szakats
e7818999db
socks_gssapi: replace gss_release_buffer() with curl free for buffers owned by libcurl
Before this patch, this code used to call `gss_release_buffer()` on
objects with buffers allocated via curl's allocator.
`gss_release_buffer()` calls system (or Win32) free on these buffers,
which may mismatch with curl's allocator. To fix it, align these calls
with the pattern used in vauth modules, by replacing
`gss_release_buffer()` with curl free to release the buffers.

Use `Curl_safefree()` to set the freed pointer to NULL, as
`gss_release_buffer()` did.

Also: use object length var when allocating.

Reported-by: Joshua Rogers

Closes #19018
2025-10-20 14:23:46 +02:00
Viktor Szakats
ccec2fae1b
GHA/curl-for-win: drop libssh
Switch back to default libssh2.

The distribution server has reliability issues (this time it works
locally though):
```
++ curl [...] --output pkg.bin https://www.libssh.org/files/0.11/libssh-0.11.3.tar.xz --output pkg.sig https://www.libssh.org/files/0.11/libssh-0.11.3.tar.xz.asc
curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2) [4x]
```
Ref: https://github.com/curl/curl/actions/runs/18651134321/job/53169147048#step:3:2391

There is also no official mirror that I know of.

Ref: af8e1aa4b0 #18257

Closes #19162
2025-10-20 14:22:14 +02:00
Viktor Szakats
a041bf6ca2
Makefile.example: make default options more likely to work
- replace default libpaths with more common ones.
- drop Solaris network libs.

Closes #19161
2025-10-20 13:52:58 +02:00
Viktor Szakats
97dd1da8d0
Makefile.example: bump default example from FTP to HTTPS
To have a chance to work out of the box, securely. (assuming a TLS
backend with CA certs setup.)

Closes #19160
2025-10-20 13:22:17 +02:00
Daniel Stenberg
1876ed6296
cf-socket: make set_local_ip void, and remove failf()
No callers of this function checked the return code, meaning failures
are not lethal == using failf was wrong, and it can just as well return
void.

Closes #19137
2025-10-20 10:57:48 +02:00
Daniel Stenberg
d2af9c9a08
INSTALL.md: add another OS (Azure Sphere)
Closes #19155
2025-10-20 10:32:08 +02:00
Daniel Stenberg
104299195e
curl_get_line: the final return cannot be reached
Follow-up to 769ccb4d42

Pointed out by CodeSonar
Closes #19154
2025-10-20 10:30:36 +02:00
Daniel Stenberg
9596c4a258
http: return error for a second Location: header
Unless it is identical to the previous one.

Follow-up to dbcaa00657

Adjusted test 580, added test 772 and 773

Fixes #19130
Reported-by: Jakub Stasiak
Closes #19134
2025-10-20 09:35:23 +02:00
Daniel Stenberg
cbd7823fd1
RELEASE-NOTES: fix typo 2025-10-20 09:09:50 +02:00
Daniel Stenberg
f21d70e76c
HTTP3: clarify the status for "old" OpenSSL, not current
Closes #19153
2025-10-20 09:07:12 +02:00
Daniel Stenberg
b5cdfcf8e2
RELEASE-NOTES: synced 2025-10-20 08:53:49 +02:00
Daniel Stenberg
0bb25cdbb7
curl_easy_setopt.md: add missing CURLOPT_POSTFIELDS
It was mistakenly removed in 8dab7465a5 (shipped in 8.9.0)

Also fix test 1139 which should have detected this but didn't due to a
bad regex check.

Reported-by: Jonathan Cardoso
Fixes #19151
Closes #119152
2025-10-20 08:50:02 +02:00
Viktor Szakats
3986149c04
GHA/windows: delete remains of Perl Win32-Process* caching
Follow-up to c8d6643df2 #19083
2025-10-20 00:25:23 +02:00
Daniel Stenberg
c21655e7ff
tool_filetime: cap crazy filetimes instead of erroring
Also cap the minimum allowed timestamp now.

Closes #19147
2025-10-20 00:00:12 +02:00
Daniel Stenberg
8504c41e2c
tool_cb_rea: use poll instead of select if available
- poll doesn't have the FD_SETSIZE problem

- select: if socket >= FD_SETSIZE, skip the call

Closes #19143
2025-10-19 23:59:37 +02:00
Daniel Stenberg
00cb679c04
openssl: remove dead code
A condition in infof_certstack() would always equal true after a
previous change.

Follow-up to e2a4de8a60

Pointed out by Coverity
Closes #19142
2025-10-19 23:48:28 +02:00
Daniel Stenberg
d3b2ba92c7
rustls: exit on error
In init_config_builder_verifier() the call to
rustls_root_cert_store_builder_build() set result on failure but did not
return.

Pointed out by ZeroPath
Closes #19125
2025-10-19 23:47:47 +02:00
Daniel Stenberg
4c636b2dc1
tool_operate: return error on strdup() failure
In src/tool_operate.c inside the Windows safe-search branch (#ifdef
CURL_CA_SEARCH_SAFE), the code assigns config->cacert = strdup(cacert);
at line 2076 without checking whether strdup returned NULL.

This would allow the code to continue with the wrong value set, causing
possible confusion.

Pointed out by ZeroPath
Closes #19145
2025-10-19 23:47:00 +02:00
Daniel Stenberg
7f19fa9819
lib: add asserts that hostname has content
For all network related protocols there must be a non-blank hostname
used. This change adds a few asserts in some places to make debug/tests
catch mistakes if any such would slip in.

Closes #19146
2025-10-19 23:45:28 +02:00
Yedaya Katsman
55e0526566
openssl: fix unable do typo in failf() calls
Closes #19149
2025-10-19 23:42:54 +02:00
Viktor Szakats
d8a7aad061
GHA/windows: drop git config core.autocrlf input steps
CI works without it now. For an inexplicable reason, this single `git`
command took 9 seconds per job, making this patch save more than
2 minutes per workflow run. It was also the only step using PowerShell.

Closes #19150
2025-10-19 23:00:50 +02:00
Daniel Stenberg
976333dd40
curl_path: make sure just whitespace is illegal
This function could previously accidentally return true and a NULL path
if only whitespace was provided as argument.

Also, make it stricter and do not allow CR or LF within the string.

Use more strparse parsing.

Drop the comment saying this is from OpenSSH as it has now been
rewritten since then.

Closes #19141
2025-10-19 16:26:01 +02:00
Daniel Stenberg
769ccb4d42
curl_get_line: enhance the API
To make sure callers can properly differentiate between errors and know
cleanly when EOF happens. Updated all users and unit test 3200.

Triggered by a remark by ZeroPath

Closes #19140
2025-10-19 16:25:11 +02:00
Daniel Stenberg
990a23bb97
libssh: return the proper error for readdir problems
The code would return without setting sshc->actualcode or returning the
CURLcode error.

Reported by ZeroPath
Closes #19135
2025-10-19 14:28:55 +02:00
Viktor Szakats
026498df43
mod_curltest: tidy-ups and small fixes
- honor request id (`id=<number>`) in `curltest/put` and
  `curltest/sslinfo` handlers.
- do not truncate `max_upload` input parameter.
- delete unused variables.
- formatting.

Inspired by Joshua's report on tests.

Closes #19061
2025-10-19 13:46:59 +02:00
Daniel Stenberg
fffc16dd9c
smtp: return value ignored
Return value from Curl_client_write was overwritten by
smtp_perform_command making errors ignored.

Pointed out by ZeroPath

Closes #19136
2025-10-19 13:17:31 +02:00
Viktor Szakats
f6334f379d
examples: replace casts with curl_off_t printf masks
Follow-up to e4ec666a3d #19112

Closes #19133
2025-10-19 13:16:32 +02:00
Daniel Stenberg
8d302ec936
socks: avoid UAF risk in error path
The code obtained a pointer resp via Curl_bufq_peek(), but called
Curl_bufq_skip() before it would access them in the failf() call.

The Curl_bufq_skip() call can trigger prune_head which may free or
recycle the chunk that resp points into.

Pointed out by ZeroPath
Closes #19139
2025-10-19 13:13:15 +02:00
Jochen Sprickerhof
f03e7c1d64
openldap: fix limit max incoming size test logic
Use LDAP_OPT_SUCCESS for ldap_get_option, as done in the other calls.
ber_sockbuf_ctrl returns 1 on success so reverse the logic.

Follow-up to f91be14bfb
Closes #19138
2025-10-19 13:12:07 +02:00
Daniel Stenberg
6550dd0f3d
wolfssl: clear variable to avoid uninitialized use
Pointed out by ZeroPath
Closes #19126
2025-10-19 11:08:14 +02:00
Tatsuhiro Tsujikawa
e0798466a8
ngtcp2: adopt ngtcp2_conn_get_stream_user_data if available
Adopt ngtcp2_conn_get_stream_user_data which has been available since
ngtcp2 v1.17.0. This improves the time complexity of searching
h3_stream_ctx from O(n) to O(1) where n is the number of stream.

Closes #19132
2025-10-19 11:07:32 +02:00
Joshua Rogers
66e3ff5d0e schannel: fix memory leak
- Do not leak memory on failed setting algorithm cipher list.

Discovered by ZeroPath.


- Do not free backend->cred after failed AcquireCredentialsHandle.

backend->cred is always freed later, during cleanup.


Closes https://github.com/curl/curl/pull/19118
2025-10-19 02:23:36 -04:00
Viktor Szakats
e779650a86
GHA/curl-for-win: update container image envs
Follow-up to 1f31ff06ad

Closes #19129
2025-10-19 01:30:19 +02:00
JimFuller-RedHat
e4ec666a3d
examples/chkspeed: portable printing when outputting curl_off_t values
Closes #19112
2025-10-18 23:26:15 +02:00
Daniel Stenberg
0217aca9f3
lib: remove newlines from failf() calls
Closes #19124
2025-10-18 23:17:54 +02:00
Daniel Stenberg
ea1eaa6f7c
tool_paramhlp: remove outdated comment in str2tls_max()
The function does not take positive number as input. It takes TLS
version strings.

Pointed out by ZeroPath
Closes #19115
2025-10-18 23:17:16 +02:00
Joshua Rogers
023e453032
openldap: do not pass newline to infof()
Discovered by ZeroPath
Closes #19120
2025-10-18 22:30:55 +02:00
Joshua Rogers
c567b37548
src/var: remove dead code
Discovered by ZeroPath
Closes #19119
2025-10-18 22:19:47 +02:00
Joshua Rogers
9021e42c02
ldap: do not pass a \n to failf()
Discovered by ZeroPath
Closes #19122
2025-10-18 22:16:33 +02:00
Joshua Rogers
bff9679a01
schannel_verify: do not call infof with an appended \n
Discovered by ZeroPath
Closes #19123
2025-10-18 22:15:26 +02:00
Viktor Szakats
a000444cb0
cmake: fix Linux pre-fill HAVE_POSIX_STRERROR_R (when _CURL_PREFILL=ON)
It depends on C library.

Follow-up to f30f1307c1 #19116
2025-10-18 14:30:43 +02:00
Viktor Szakats
f30f1307c1
cmake: fix Linux pre-fills for non-glibc (when _CURL_PREFILL=ON)
- do not pre-fill `HAVE_LINUX_TCP_H` on Linux.
  `linux/tcp.h` is a Linux kernel userspace header. It's likely
  installed when using glibc and likely missing by default when using
  something else, e.g. MUSL (e.g. on Alpine).

  Therefore always detect it for Linux targets, and only pre-fill it for
  non-Linux ones.

- do not pre-fill `HAVE_GLIBC_STRERROR_R` on Linux.
  To fix it for non-glibc envs, e.g. MUSL (e.g. on Alpine).

Note, the pre-fill option is a disabled by default, internal option and
strongly not recommended outside of curl development.

Closes #19116
2025-10-18 13:53:30 +02:00