| commit | 73840836a51c443e6b5d385014ce1c8f5be3e02b | [log] [tgz] |
|---|---|---|
| author | Viktor Szakats <commit@vsz.me> | Wed Jun 25 01:45:04 2025 +0200 |
| committer | Viktor Szakats <commit@vsz.me> | Tue Jul 01 00:17:15 2025 +0200 |
| tree | 18a54a727fcb0f6aefb3e26d1e2995ddce21eae8 | |
| parent | c9bb9cd165c1b25c2fe005befdcfe479fc9b68e1 [diff] |
tests: move GSS-API dynamic stub into debug-mode libcurl Replace the `libstubgss.so`-based overload solution with one built into libcurl at compile-time. The previous, `LD_PRELOAD`-based, solution was non-portable, allowlisted for Linux, BSD and Solaris. It also required non-debug builds, which turned out to be an accidental condition: 7d342c723c5ae8e9312210936287810741f40bc5. It also required a curl tool built against a shared libcurl. Detecting this condition wasn't always accurate, e.g. with certain cmake configurations. The overload solution also didn't work on macOS, though it theoretically should have: - #17653 - #2394 Experiments on making the overload solution work in more envs: - #17759 That revealed that it also did not work on NetBSD, in CI. The replacement solution is overloading the necessary GSS-API functions for test 2056 and 2057 at compile time. It requires a debug-enabled curl build (due to its insecure nature). This makes these tests run on all platforms. Including most GSS jobs in CI, that are running tests. (the exception is old-linux, non-debug jobs, where it felt overkill to enable debug for this.) The refactored GSS stub code needs to overload less than before because it's free to use the official GSS API. (This didn't work with the overload solution on Alpine for example). It can also use libcurl functions, allowing to replace `snprintf()` with `msnprintf()`. OS/400 is also overloading GSS API functions. I haven't tested how this works after this PR. In theory it should, because this PR doesn't rely on preprocessor overrides. Note that for future GSS tests, it may be necessary to stub these GSS API functions: `gss_inquire_context()`, `gss_unwrap()`, `gss_wrap()`. They are on codepaths not (yet) touched by tests. Also: - stub-gss: check for token buffer overrun. - stub-gss: replace size macros with `sizeof()`. - GHA: enable debug for some jobs with GSS. - GHA/linux: ignore results for 2056 and 2057 in the valgrind job. They leak the same way as seen with 2077 and 2078. Ref: 7020ba797961d38c3bf24539f9bb407e0586274d #17462 Ref: 146759716cbacfd453b9fb13d1096f0595424a6c #14430 - GHA/linux: fix to ignore `gss_import_name()` leaks in valgrind builds. only. - lib/vauth/krb5_gssapi: reduce variable scope. - lib/vauth/spnego_gssapi: reduce variable scope. - tests/libtest: drop code and build logic dealing with `libstubgss`. - runtests: - drop `ld_preload` feature. - drop special handling of `LD_PRELOAD` env in tests. - drop logic dealing with shared curl tool detection. - drop `LD_PRELOAD` envs from tests. Follow-up to 56d949d31ad182a22bd3bad25b1a902b635d549d #1687 Closes #17752
curl is a command-line tool for transferring data specified with URL syntax. Learn how to use curl by reading the manpage 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 manpage to learn how.
curl is Open Source and is distributed under an MIT-like license.
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.
For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.
Visit the curl website for the latest news and downloads.
Download the latest source from the Git server:
git clone https://github.com/curl/curl.git
Report suspected security problems via our HackerOne page and not in public.
curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.
Thank you to all our backers :pray: Become a backer.
Support this project by becoming a sponsor.