测试 mirror
Go to file
Viktor Szakats c07a7f6bf8
runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job)
test 1459 "SFTP with corrupted known_hosts" was seen failing in the past.
To fix it, the test was automatically disabled when detecting libssh
0.9.3 or older, as in the curl CircleCI job, running on Ubuntu 20.04.
This work for a long time, until bumping the CircleCI runner to Ubuntu
22.04 (to have OpenSSL 3), where the test was running again, and failing
with the isssue seen in the past.

- Test skipped with Ubuntu 20.04 (libssh 0.9.3):
  https://app.circleci.com/pipelines/github/curl/curl/16445/workflows/7f198763-e0b0-4037-9245-4c4b40ab8726/jobs/155164
- Failure seen with Ubuntu 22.04 (libssh 0.9.6):
  https://app.circleci.com/pipelines/github/curl/curl/16452/workflows/b817a808-0fd4-40b0-8eb0-d064926efe12/jobs/155206?invite=true#step-107-211709_45
- Failure seen with Ubuntu 24.04 (libssh 0.10.6):
  https://app.circleci.com/pipelines/github/curl/curl/16455/workflows/86c631f1-3c5f-4438-b398-3df2bdab5d20/jobs/155218

Turns out the issue issue isn't libssh 0.9.3 itself, but
a CircleCI-specific default configuration in `/etc/ssh/ssh_config`:
```
# BEGIN ANSIBLE MANAGED BLOCK
Host *
StrictHostKeyChecking no     <------ this particular line
HashKnownHosts no
SendEnv LANG LC_*
# END ANSIBLE MANAGED BLOCK
```

libssh will consult configuration files on hard-coded default system
locations and alter its behavior based on settings found in them.

This libssh behavior is present in all supported versions:
5a2abd34ce
https://gitlab.com/libssh/libssh-mirror/-/tags/libssh-0.9.0

It means the existing disable logic based on libssh version worked by
coincidence, and what needs to be checked is these configurations
to decide if it's safe to run the test. Another, simpler option is
to also accept the result code 67, though in that case the test
wouldn't actually test what we want, but would pass anyway.

With the old `oldlibssh` workaround deleted, and the problematic setting
manually overridden (`StrictHostKeyChecking yes`):
- CircleCI Ubuntu 20.04 passes with 1459 enabled:
  https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155302
- CircleCI Ubuntu 22.04 does too:
  https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155303

To fix, replace the `runtests` `oldlibssh` detection logic to parse
libssh config files (instead of checking for libssh version) and disable
test 1459 based on that. Notice the detection is making a light attempt
to parse these files, and does not implement most config file features
(such as includes, quoted values and `=` operator.)

The new runtests workaround tests OK with the:
- default CircleCI configuration, disabling 1459 automatically.
- a sudoless configuration fix, with 1459 run successfully.
  Also keep setting this option in CircleCI jobs.
- a sudo configuration fix, with 1459 run successfully.
Ref: https://app.circleci.com/pipelines/github/curl/curl/16492/workflows/56f39335-97ba-412c-9a9b-3d662694375a

GHA jobs are not affected and they work fine, with 1459 running successfully
before and after this patch.

It's possible the libssh API offers ways to control config file use
and/or set the strict host checking option programatically. Maybe
to enable in debug mode (albeit CircleCI job are not debug-enabled),
or offer an option for them. It may be something for a future patch.

Follow-up to 23540923e1 #8622
Follow-up to 4b01a57c95 #8548
Follow-up to bdc664a640 #8490
Follow-up to 7c140f6b2d #8444

Ref: 6d9c5c91b9 #19549

Closes #19557
2025-11-16 23:28:44 +01:00
.circleci runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job) 2025-11-16 23:28:44 +01:00
.github GHA/codeql: limit cron job to the origin repository 2025-11-16 19:51:20 +01:00
CMake build: drop support for VS2008 (Windows) 2025-11-15 15:56:19 +01:00
docs runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job) 2025-11-16 23:28:44 +01:00
include build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
lib rustls: minor adjustment of sizeof() 2025-11-16 17:54:49 +01:00
LICENSES krb5: drop support for Kerberos FTP 2025-09-20 23:58:28 +02:00
m4 openssl: bump minimum OpenSSL version to 3.0.0 2025-11-15 15:56:31 +01:00
packages code: minor indent fixes before closing braces 2025-11-13 17:27:40 +01:00
plan9 tidy-up: LibreSSL Git repository URLs and local CI builds 2025-10-01 12:55:20 +02:00
projects build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
scripts mk-ca-bundle.pl: default to SHA256 fingerprints with -t option 2025-11-15 03:06:33 +01:00
src build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
tests runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job) 2025-11-16 23:28:44 +01:00
.dir-locals.el copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
.editorconfig .editorconfig: add 2025-09-02 08:36:40 +02:00
.git-blame-ignore-revs copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
.gitattributes winbuild: MS-DOS batch tidy-ups 2024-07-02 19:26:15 +02:00
.gitignore build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
.mailmap REUSE: add copyright header to two files 2025-11-03 16:08:52 +01:00
acinclude.m4 build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
appveyor.sh openssl: bump minimum OpenSSL version to 3.0.0 2025-11-15 15:56:31 +01:00
appveyor.yml openssl: bump minimum OpenSSL version to 3.0.0 2025-11-15 15:56:31 +01:00
buildconf copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CHANGES.md CHANGES: rename to CHANGES.md, no longer generated 2024-08-01 13:37:12 +02:00
CMakeLists.txt openssl: bump minimum OpenSSL version to 3.0.0 2025-11-15 15:56:31 +01:00
configure.ac build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
COPYING COPYING: bump copyright year range to 1996 - 2025 2025-01-01 21:12:12 +01:00
curl-config.in curl-config: remove X prefix use 2025-08-04 10:01:07 +02:00
Dockerfile Dockerfile: update debian:bookworm-slim digest to 936abff 2025-11-05 15:24:21 +01:00
GIT-INFO.md REUSE: add copyright header to two files 2025-11-03 16:08:52 +01:00
libcurl.pc.in configure: do not echo most inherited LDFLAGS to config files 2024-11-14 09:55:45 +01:00
Makefile.am scripts: use end-of-options marker in find -exec commands 2025-11-10 18:52:29 +01:00
README krb5: drop support for Kerberos FTP 2025-09-20 23:58:28 +02:00
README.md badwords: re-sync with curl-www, fix issues found 2025-11-12 00:53:44 +01:00
RELEASE-NOTES RELEASE-NOTES: codespell 2025-11-13 11:46:13 +01:00
renovate.json renovate.json: drop parentheses from group names 2025-11-10 09:48:05 +01:00
REUSE.toml tests/data: add %includetext, dedupe XML payloads into external file 2025-11-13 12:24:50 +01:00
SECURITY.md docs: Clarify OpenSSF Best Practices vs Scorecard 2024-08-22 11:50:20 +02:00

curl logo

curl is a command-line tool for transferring data from or to a server using URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.

Learn how to use curl by reading the man page or everything curl.

Find out how to install curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl man page to learn how.

Open Source

curl is Open Source and is distributed under an MIT-like license.

Contact

Contact us on a suitable mailing list or use GitHub issues/ pull requests/ discussions.

All contributors to the project are listed in the THANKS document.

Commercial support

For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.

Website

Visit the curl website for the latest news and downloads.

Source code

Download the latest source from the Git server:

git clone https://github.com/curl/curl.git

Security problems

Report suspected security problems via our HackerOne page and not in public.

Backers

Thank you to all our backers 🙏 Become a backer.

Sponsors

Support this project by becoming a sponsor.