{"author":"Viktor Szakats","author_email":"commit@vsz.me","author_time":1750808704,"commit_time":1751321835,"committer":"Viktor Szakats","committer_email":"commit@vsz.me","hash":"73840836a51c443e6b5d385014ce1c8f5be3e02b","message":"tests: move GSS-API dynamic stub into debug-mode libcurl\n\nReplace the `libstubgss.so`-based overload solution with one built into\nlibcurl at compile-time.\n\nThe previous, `LD_PRELOAD`-based, solution was non-portable, allowlisted\nfor Linux, BSD and Solaris. It also required non-debug builds, which\nturned out to be an accidental condition:\n7d342c723c5ae8e9312210936287810741f40bc5. It also required a curl tool\nbuilt against a shared libcurl. Detecting this condition wasn't always\naccurate, e.g. with certain cmake configurations.\n\nThe overload solution also didn't work on macOS, though it theoretically\nshould have:\n- #17653\n- #2394\n\nExperiments on making the overload solution work in more envs:\n- #17759\n  That revealed that it also did not work on NetBSD, in CI.\n\nThe replacement solution is overloading the necessary GSS-API functions\nfor test 2056 and 2057 at compile time. It requires a debug-enabled curl\nbuild (due to its insecure nature).\n\nThis makes these tests run on all platforms. Including most GSS jobs in\nCI, that are running tests. (the exception is old-linux, non-debug jobs,\nwhere it felt overkill to enable debug for this.)\n\nThe refactored GSS stub code needs to overload less than before because\nit's free to use the official GSS API. (This didn't work with\nthe overload solution on Alpine for example). It can also use libcurl\nfunctions, allowing to replace `snprintf()` with `msnprintf()`.\n\nOS/400 is also overloading GSS API functions. I haven't tested how this\nworks after this PR. In theory it should, because this PR doesn't rely\non preprocessor overrides.\n\nNote that for future GSS tests, it may be necessary to stub these GSS\nAPI functions: `gss_inquire_context()`, `gss_unwrap()`, `gss_wrap()`.\nThey are on codepaths not (yet) touched by tests.\n\nAlso:\n- stub-gss: check for token buffer overrun.\n- stub-gss: replace size macros with `sizeof()`.\n- GHA: enable debug for some jobs with GSS.\n- GHA/linux: ignore results for 2056 and 2057 in the valgrind job.\n  They leak the same way as seen with 2077 and 2078.\n  Ref: 7020ba797961d38c3bf24539f9bb407e0586274d #17462\n  Ref: 146759716cbacfd453b9fb13d1096f0595424a6c #14430\n- GHA/linux: fix to ignore `gss_import_name()` leaks in valgrind builds.\n  only.\n- lib/vauth/krb5_gssapi: reduce variable scope.\n- lib/vauth/spnego_gssapi: reduce variable scope.\n- tests/libtest: drop code and build logic dealing with `libstubgss`.\n- runtests:\n  - drop `ld_preload` feature.\n  - drop special handling of `LD_PRELOAD` env in tests.\n  - drop logic dealing with shared curl tool detection.\n  - drop `LD_PRELOAD` envs from tests.\n\nFollow-up to 56d949d31ad182a22bd3bad25b1a902b635d549d #1687\n\nCloses #17752\n","parents":["c9bb9cd165c1b25c2fe005befdcfe479fc9b68e1"],"tree_hash":"18a54a727fcb0f6aefb3e26d1e2995ddce21eae8"}