cmake: Add option WITH_HERMETIC_USR

Add a cmake option to enable hermetic-usr, i.e., use of config files in /usr/.
If turned on, GLOBAL_*_CONFIG is prepended with /usr/ and defined as
USR_GLOBAL_*_CONFIG. Config lookup follows this path GLOBAL_*_CONFIG ->
USR_GLOBAL_*_CONFIG.

Introduce a ssh_config_parse primitive. This avoids convoluted checks for file
presence (without modifing the behaviour of ssh_config_parse_file) and allows
marking whether the config is global at the call site.

Signed-off-by: Lucas Mulling <lucas.mulling@suse.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Lucas Mulling
2025-02-17 14:13:53 -03:00
committed by Jakub Jelen
parent 6b83aa9a40
commit 3372c2ad78
7 changed files with 119 additions and 57 deletions

View File

@@ -49,9 +49,10 @@
#endif
#endif
#include <stdarg.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#ifdef _MSC_VER
typedef int mode_t;

View File

@@ -25,6 +25,7 @@
extern "C" {
#endif
int ssh_config_parse(ssh_session session, FILE *fp, bool global);
int ssh_config_parse_file(ssh_session session, const char *filename);
int ssh_config_parse_string(ssh_session session, const char *input);
int ssh_options_set_algo(ssh_session session,