Commit Graph

35764 Commits

Author SHA1 Message Date
Yedaya Katsman
05ffeeda0c
tests: fail torture if !valgrind&threaded resolver
We don't check the memory debug output with the threaded resolver, so
the only way to do it with with valgrind.

Also move the disabling of memory tracking to where we log that we're
doing it.

Closes #17501
2025-06-10 15:46:47 +02:00
Yedaya Katsman
bc7d88cc8a
tests: torture: don't duplicate valgrind command
When running torture tests with valgrind enabled, the torture function
got a command line that already had the valgrind invocation in it. It
added another, at the end resulting in an empty valgrind log file.

Remove the duplicate logic adding valgrind, which already had a bit of
different logic that wasn't updated when the other one was.

Closes #17501
2025-06-10 15:46:13 +02:00
Daniel Stenberg
1d9c1e4b0f
RELEASE-NOTES: synced 2025-06-10 07:48:17 +02:00
Daniel Stenberg
b530c11bfd
curl.h: remove the "RESERVED" error codes
Return codes for tests should be kept private.

Follow-up to 9465327084

Closes #17563
2025-06-09 23:57:23 +02:00
Daniel Stenberg
1886260a95
lib: make curlx_inet_ntop()
move function to curlx/, change all callers

Closes #17560
2025-06-09 13:16:01 +02:00
Viktor Szakats
c347b43e5c
GHA/hacktoberfest-accepted: prefer GH_TOKEN
For the `gh` tool, over `GITHUB_TOKEN`. It accepts both, of which
the former seems to be preferred according to the source code and
documentation.

GHA/appveyor-status already uses `GH_TOKEN`.

Closes #17556
2025-06-09 12:28:47 +02:00
Carlos Henrique Lima Melara
0ede81dcc6
curl_path: make SFTP handle a path like /~ properly.
... without a trailing slash.

Fixes #17534
Closes #17542
2025-06-09 11:23:16 +02:00
Stefan Eissing
c314759c4c
pingpong: on disconnect, check for unflushed pingpong state
When a pingpong based protocol tries to perform a connection disconnect,
it sends a sort of "logout" command to the server, unless the connection
is deemed dead.

But the disconnect might happen before pingpong data has been completely
sent, in which case sending the "logout" will not work. Check the
pingpong state and do not "logout" when data is pending.

This was detected as a condition in fuzzing that triggered a debug
assert in the pingpong sending.

Closes #17555
2025-06-09 11:22:19 +02:00
Daniel Stenberg
b42776b4f4
tool_operate: fix return code when --retry is used but not triggered
Verify with test 752

Reported-by: fjaell on github
Fixes #17554
Closes #17559
2025-06-09 09:10:06 +02:00
Viktor Szakats
128c5ddc6b
GHA: enclose if expressions in ${{ }} where missing
Enclosing expressions in `${{ }}` is optional, but sometimes required.
It seems more straighforward to use it always rather than decide on
a case-by-case basis. Before this patch 71 `if`s were enclosed and 49
were not. Enclosing these makes it easy to grep and recognize these
whereever used.

https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/using-conditions-to-control-job-execution

Closes #17550
2025-06-08 13:01:24 +02:00
Dan Fandrich
5f805eec11 tool_getparam: fix --ftp-pasv
This boolean option was moved to the wrong handling function. Make it
an ARG_NONE and move it to the correct handler and add a test to
verify that the option works.

Follow-up to 698491f44

Reported-by: fjaell on github
Fixes #17545
Closes #17547
2025-06-06 14:40:14 -07:00
Viktor Szakats
900612df79
GHA: tidy up single-line run blocks
Also double quote a shell variable.

Closes #17552
2025-06-06 23:24:27 +02:00
Daniel Stenberg
f33ec60fbf
tests/servers.pm: add more ways to figure out current user
Some CI tests fail due to "Can't start ssh server due to lack of USER name" -
add more ways to try to figure it out if no environment variable works: the
whoami and id commands.

Closes #17544
2025-06-06 23:07:29 +02:00
Viktor Szakats
d16a020a87
GHA/hacktoberfest-accepted: tidy up item order
`if`, then `env`, then `run`.

Also tidy up quotes in env entries.

Closes #17551
2025-06-06 23:02:04 +02:00
Viktor Szakats
17a669426f
CI: fix zizmor 1.9.0 warnings, shellcheck verify CI shell code, fix fallouts
zizmor 1.9.0 effectively bans using GHA macros within shell script
snippets. Rework them to pass GHA macro values via envs and use those
envs in shell snippets. `${{ env.* }}` macros could be converted
to native env references after making their names shell-compatible.

Envs and shell commands can no longer be used in GHA macro values. Most
cases could be fixed by using literals. Passing quoted values with
spaces combined with other args also doesn't work anymore. This was
replaced by passing them separately.

Despite the initial complications, avoiding GHA macros in scripts does
seems to make the CI code reasonable cleaner. It also makes it possible
to analyze the scripts with shellcheck, finding subtle issues that went
unnoticed till now.

Also:
- un-ignore and fix three existing zizmor `template-injection` issues.
- add script to extract and shellcheck all shell code stored within GHA
  and Circle CI YAML files.
- add CI job to run this script.
- fix shellcheck issues discovered.
- fix minor differences between cmake and autotools FreeBSD jobs.
- merge cmake/autotools FreeBSD jobs to avoid developing unwanted
  differences again.
- fix/sync quote use across shell code.
- replace `$HOME` with `~` or literal where it made sense.
- replace most `brew --prefix` with literals.
- move all curl install tests to the `curl-install*` prefix.
- add missing curl install tests to cygwin/msys/mingw/*bsd.
- pipe to `tar` instead of storing downloads on disk.
- drop unnecessary `PKG_CONFIG_PATH` when building nghttp3.

Ref: https://github.com/curl/curl/actions/runs/15461461371/job/43523546041
Ref: https://github.com/zizmorcore/zizmor/releases/tag/v1.9.0

Follow-up to e522f47986 #17278

Closes #17537
2025-06-06 21:30:43 +02:00
Daniel Stenberg
ba407ee43d
RELEASE-NOTES: synced
Bump to 8.14.2 - a tentative version we probably will not release.
2025-06-05 13:54:53 +02:00
Stefan Eissing
d9bebede59
pytest: adapt for runs with openssl-1.1.1
Fix use of nghttpx fixture to be present even when h3 is not
available in curl. Fix TLS protocol versions expectations for
older openssl versions.

Closes #17538
2025-06-05 13:52:29 +02:00
Stefan Eissing
5d9f425302
pytest: disable test_07_37 and test_07_36 with openssl's quic
These tests fail often in CI and I have no motivation to find out why.
Disable the tests for openssl's own QUIC.

Closes #17539
2025-06-05 13:50:41 +02:00
Stefan Eissing
98719c9d91
fuzzer: get the deadlock unstuck
Change the workflow name to change the concurrency lock name so
that the invoked Fuzzer workflow does no longer lock the same name.

Closes #17541
2025-06-05 13:49:46 +02:00
Daniel Stenberg
0b2619cb7f
curl.h: make CURLSSLOPT_* symbols defined as longs
Help users get them used right.

Closes #17535
2025-06-05 12:41:15 +02:00
John Haugabook
3035b8e7a4
INSTALL.md: cygwin details and add source code link
Added more details to help with cygwin install, adding links to curl
source code where relevant to help save people a little time.

Closes #17485
2025-06-05 12:37:07 +02:00
Daniel Stenberg
fae5784346
docs/examples: add ftp-delete.c
To show how to delete a single file after a transfer

Closes #17540
2025-06-05 12:17:21 +02:00
Daniel Stenberg
614313f12f
system.h: remove some macros
Since curl_off_t is always 64 bit these days, we can simplify and avoid
using some macros.

Closes #17498
2025-06-05 10:56:31 +02:00
Stefan Eissing
68c02e6ab7
CI: fix OpenBSD tests stall
impacket could not be used as it neeeds package six

- openbsd does not find python3, add package six
- http2-server.pl: only warn about unknown parameter if not empty string

Closes #17532
2025-06-05 09:12:22 +02:00
Stefan Eissing
34d694f89c
SCP/SFTP: avoid busy loop after EAGAIN
The ssh libraries do not reveal if they still have data buffered from
the peer. Only when their buffers are read empty can curl be sure that
it is safe to rely on socket polling.

This change adds detection of EGAIN on receive in the transfer loop and
allows SFTP/SCP transfers to avoid a busy loop in such a case (which
should happen often when CPU exceeds network bandwidth).

Closes #17533
2025-06-05 09:11:29 +02:00
Stefan Eissing
e67a500841
test1117: reduce write delays
Test1117 seems to verify that a response, incoming slowly, is read
completely before sending another request on the same connection.

The previsou write delay of 1000ms made the test last 23+ seconds.
A delay of 100ms seems to achieve the same test on modern machines, but
the overall run time is less than 3 seconds.

Closes #17530
2025-06-04 15:54:17 +02:00
Daniel Stenberg
fdb8a789d2
RELEASE-NOTES: synced
8.14.1 release
2025-06-04 07:40:18 +02:00
Daniel Stenberg
cda3bb3741
THANKS: add names from 8.14.1 release 2025-06-04 07:40:18 +02:00
Viktor Szakats
80f9dd0eb8
cmake: enable -std=gnu99 for Windows CE CeGCC
To sync with autotools, which auto-detects this option and enables it by
default.

It also makes it possible to compile unsuffixed long long integer
literals correctly, allowing to drop some legacy macros without bumping
into build errors like:
```
lib/vtls/schannel.c: In function 'schannel_send':
lib/vtls/schannel.c:1815: error: integer constant is too large for 'long' type
```
Ref: https://github.com/curl/curl/actions/runs/15374705821/job/43286736583?pr=17498#step:9:20

Bug: https://github.com/curl/curl/pull/17498#issuecomment-2925507481
Reported-by: Daniel Stenberg

Closes #17523
2025-06-03 23:36:58 +02:00
Jeremy Drake
7a30481760 dllmain: exclude from Cygwin builds
On Cygwin, it is unsafe to call POSIX functions from DllMain, which
OPENSSL_thread_stop does.  Additionally, it should be unnecessary as
OpenSSL uses pthread_key_create to register a thread destructor to do
thread cleanup in a POSIX way.

Reported-by: Yuyi Wang

Ref: https://cygwin.com/pipermail/cygwin/2025-June/258235.html

Fixes #17262
Closes https://github.com/curl/curl/pull/17528
2025-06-03 14:30:31 -04:00
Stefan Eissing
f1e1c8b98a
tls BIOs: handle BIO_CTRL_EOF correctly
Needs to return 1 if EOF from underlying filter has been seen.

Fixes #17471
Reported-by: Michael Kaufmann
Closes #17526
2025-06-03 16:52:01 +02:00
Daniel Stenberg
c7658f274c
curl: make -N handled correctly
Options marked ARG_NO should have their 'toggle' value reverted when the
short option is used as it implies using the --no- prefix.

-N happens be the only short option flag for a --no- long option.

Reported-by: Stefan Eissing
Closes #17527
2025-06-03 16:51:00 +02:00
Viktor Szakats
741748e341
autotools: recognize more Linux targets when setting -D_GNU_SOURCE
To set `-D_GNU_SOURCE`.

Required to declare `accept4` on uclibc targets. `host_os` can have
the value `uclinux-uclibcgnueabi` in this case.

Fixing:
```
cf-socket.c: In function 'cf_tcp_accept_connect':
cf-socket.c:2141:18: error: implicit declaration of function 'accept4'; did you mean 'accept'? [-Werror=implicit-function-declaration]
 2141 |     s_accepted = accept4(ctx->sock, (struct sockaddr *) &add, &size,
```

Follow-up to 3d02872be7 #16979

Reported-by: Kadambini Nema
Fixes #17512
Closes #17524
2025-06-03 09:51:41 +02:00
Daniel Stenberg
f6ab4c8b75
cmdline-docs: mention HTTP resumed uploads to be shaky
In the documentation for the --continue-at and --range options.

A future version could implement support for the new standard HTTP resumed
uploads mechanism.

Ref: #17510
Closes #17521
2025-06-02 23:23:50 +02:00
Stefan Eissing
a084ad543e
pytest: do not use reserved chars in url queries
Closes #17458
2025-06-02 23:17:35 +02:00
Stefan Eissing
dc60a82747
scorecard: rework format and add json print
Improve the JSON result format to be more descriptive and
easier to parse.

Add --print option to scorecard.py that prints a saved JSON file
Add date field to score card.

Closes #17465
2025-06-02 23:15:33 +02:00
Daniel Stenberg
700b5445b2
test1498: verify "-T ."
Closes #17519
2025-06-02 13:33:20 +02:00
Daniel Stenberg
ccdcf40c38
RELEASE-NOTES: synced 2025-06-02 13:02:12 +02:00
Stefan Eissing
78dd083788
curl: upload from '.' fix
CURLOPT_NOPROGRESS is being set twice, if a file is uploaded from '.'.

Fix order of options so that '.' can override the global setting. Without
this, the `tool_readbusy_cb()` is never inoked and cannot unpause a
transfer waiting for more input.

Fixes #17513
Reported-by: denandz on github
Closes #17517
2025-06-02 12:49:38 +02:00
Daniel Stenberg
d591bc1416
tool_getparam: make --no-anyauth not be accepted
It was previously just ignored, now it triggers an error. It was never
documented (nor intended) to work.

Fixes #17508
Reported-by: Dan Fandrich
Closes #17511
2025-06-02 11:19:04 +02:00
Ruocco, Calvin
d3594be653
ws: tests and fixes
This started out as regression tests for the `curl_ws_recv()` and
`curl_ws_send()` implementation and ended up with a bugfix, additional
protocol validation and minor logging improvements.

- Fix reset of fragmented message decoder state when a PING/PONG is
  received in between message fragments.

- Fix undefined behavior (applying zero offset to null pointer) in
  curl_ws_send() when the given buffer is NULL.

- Detect invalid overlong PING/PONG/CLOSE frames.
- Detect invalid fragmented PING/PONG/CLOSE frames.
- Detect invalid sequences of fragmented frames.

  - a) A continuation frame (0x80...) is received without any ongoing
    fragmented message.
  - b) A new fragmented message is started (0x81/0x01/0x82/0x02...)
    before the ongoing fragmented message has terminated.

- Made logs for invalid opcodes easier to understand.
- Moved noisy logs to the `CURL_TRC_WS` log level.
- Unified the prefixes for WebSocket log messages: `[WS] ...`

- Add env var `CURL_WS_FORCE_ZERO_MASK` in debug builds.

  - If set, it forces the bit mask applied to outgoing payloads to
    0x00000000, which effectively means the payload is not masked at
    all. This drastically simplifies defining the expected `<protocol>`
    data in test cases.

- 2700: Frame types
- 2701: Invalid opcode 0x3
- 2702: Invalid opcode 0xB
- 2703: Invalid reserved bit RSV1 _(replaces 2310)_
- 2704: Invalid reserved bit RSV2
- 2705: Invalid reserved bit RSV3
- 2706: Invalid masked server message
- 2707: Peculiar frame sizes _(part. replaces 2311)_
- 2708: Automatic PONG
- 2709: No automatic PONG _(replaces 2312)_
- 2710: Unsolicited PONG
- 2711: Empty PING/PONG/CLOSE
- 2712: Max sized PING/PONG/CLOSE
- 2713: Invalid oversized PING _(replaces 2307)_
- 2714: Invalid oversized PONG
- 2715: Invalid oversized CLOSE
- 2716: Invalid fragmented PING
- 2717: Invalid fragmented PONG
- 2718: Invalid fragmented CLOSE
- 2719: Fragmented messages _(part. replaces 2311)_
- 2720: Fragmented messages with empty fragments
- 2721: Fragmented messages with interleaved pong
- 2722: Invalid fragmented message without initial frame
- 2723: Invalid fragmented message without final frame

- 2305: curl_ws_recv() loop reading three larger frames
  - This test involuntarily sent an invalid sequence of opcodes (0x01...,0x01...,0x81...) , but neither libcurl nor the test caught this! The correct sequence was tested in 2311 (0x01...,0x00...,0x80...). See below for 2311.
  - Validation of the opcode sequence was added to libcurl and is now tested in 2723.
  - Superseded by 2719 (fragmented message) and 2707 (large frames).
- 2307: overlong PING payload
  - The tested PING payload length check was actually missing, but the test didn't catch this since it involuntarily sent an invalid opcode (0x19... instead of 0x89...) so that the expected error occurred, but for the wrong reason.
  - Superseded by 2713.
- 2310: unknown reserved bit set in frame header
  - Superseded by 2703 and extended by 2704 and 2705.
- 2311: curl_ws_recv() read fragmented message
  - Superseded by 2719 (fragmented message) and 2707 (large frames).
- 2312: WebSockets no auto ping
  - Superseded by 2709.

- No tests for `CURLOPT_WRITEFUNCTION`.
- No tests for sending of invalid frames/fragments.

Closes #17136
2025-06-02 11:15:38 +02:00
Stefan Eissing
04c3895ceb
tests: improve server start reliability
Fix all lookups of the port a server is using by
- unlinking the portfile before the start
- waiting `timeout` seconds for the port file to exist
  and contain a positive number
- check results and fail server start when port could
  not be determined

Closes #17516
2025-06-02 11:03:10 +02:00
Stefan Eissing
e61c287e73
test1510: fix expectation
The test had `Closing connection 0` in its expectations, but a stripfile
expression that removes such lines. No recent changes, but started failing
this morning.

Too little coffee for me? Or what triggered this?

Closes #17515
2025-06-02 11:02:14 +02:00
Daniel Stenberg
f738093896
asyn-thrdd: fix cleanup when RR fails due to OOM
Fixes #17507
Closes #17514
2025-06-02 09:08:04 +02:00
Viktor Szakats
516e9ccab3
GHA/non-native: un-ignore tests on OpenBSD, bump to -j8 for NetBSD/FreeBSD
- un-ignore tests (3017, FTP, TFTP) on OpenBSD
  Patch-by: Jacob Mealey
  Ref: https://github.com/curl/curl/issues/13623#issuecomment-2925129037
  Fixes: #13623

- KNOWN_BUGS: drop TFTP failures issue on OpenBSD.
  Fixes: #13623

- bump test parallelism to `-j8` (from `-j4`) for NetBSD, FreeBSD,
  to match OpenBSD.
  Before: https://github.com/curl/curl/actions/runs/15371760479
  After: https://github.com/curl/curl/actions/runs/15371937205

- FreeBSD: sync cmake `TFLAGS` with autotools. (This branch is not
  currently hit in CI.)
  Follow-up to 7f3d598276 #15040

Closes #17505
2025-06-02 00:21:52 +02:00
Viktor Szakats
7020ba7979
tests: re-enable 1510, unignore 2027 2051 in GHA/macos, document heimdal memleak
- test1510: it was marked flaky, then disabled. Keep the flaky flag
  and allow it to run again.
  Ref: ef02da3156
  Ref: 0110cced2a

- GHA/linux: extend information about the heimdal valgrind failures.

- GHA/macos: unignore 2037 2041 in torture tests. They no longer
  appear flaky.
  Follow-up to 4b791dca37 #14667

Closes #17462
2025-06-02 00:21:51 +02:00
Yedaya Katsman
4ac7087306
docs/tests: remove mention of hyper
Closes #17500
2025-06-01 13:45:52 +02:00
Yedaya Katsman
8645e4f6ee
license: update some copyright links to curl.se
Instead of curl.haxx.se

Also widen the .gitignore for libtest, since it missed libtest751,
so ignore three digit tests that start with 5-9 instead of just 5-6.

Closes #17502
2025-06-01 13:44:15 +02:00
Daniel Stenberg
70115763c3
memanalyze.pl: fix getaddrinfo/freeaddrinfo checks
It did not parse them correctly. Problem never shows before we don't run
torture tests with these functions - yet.

Seen when enabling torture tests with the threaded resolver.

Closes #17503
2025-06-01 10:24:31 +02:00
Daniel Stenberg
83c90e5047
VULN-DISCLOSURE-POLICY.md: the distros list wants <= 7 days embargo
Closes #17497
2025-05-31 18:00:58 +02:00