diff options
author | Stefan Schubert <schubi@suse.de> | 2024-06-27 16:06:36 +0200 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2024-07-02 08:00:00 +0000 |
commit | bc461898448a1bf306fc094cdf6a5a197c4e2753 (patch) | |
tree | 03a14e47e3cbdfbe55e15aee53a2183700dd9737 /libpam_internal/pam_econf.c | |
parent | efa6e33b1da594f2a2c4c2c8871416a3d5011015 (diff) | |
download | pam-bc461898448a1bf306fc094cdf6a5a197c4e2753.tar.gz pam-bc461898448a1bf306fc094cdf6a5a197c4e2753.tar.bz2 pam-bc461898448a1bf306fc094cdf6a5a197c4e2753.zip |
libpam_internal: introduce pam_econf_readconfig
Use this new function instead of econf_readDirs() and
econf_readDirsWithCallback().
Co-authored-by: Dmitry V. Levin <ldv@strace.io>
Diffstat (limited to 'libpam_internal/pam_econf.c')
-rw-r--r-- | libpam_internal/pam_econf.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libpam_internal/pam_econf.c b/libpam_internal/pam_econf.c new file mode 100644 index 00000000..595c122a --- /dev/null +++ b/libpam_internal/pam_econf.c @@ -0,0 +1,34 @@ +/* pam_econf.c -- routines to parse configuration files with libeconf */ + +#include "config.h" + +#ifdef USE_ECONF + +#include <stdio.h> +#include <security/_pam_macros.h> +#include "pam_econf.h" + +econf_err pam_econf_readconfig(econf_file **key_file, + const char *usr_conf_dir, + const char *etc_conf_dir, + const char *config_name, + const char *config_suffix, + const char *delim, + const char *comment, + bool (*callback)(const char *filename, const void *data), + const void *callback_data) +{ + econf_err ret; + D(("Read configuration from directory %s and %s", etc_conf_dir, usr_conf_dir)); + ret = econf_readDirsWithCallback(key_file, + usr_conf_dir, + etc_conf_dir, + config_name, + config_suffix, + delim, + comment, + callback, callback_data); + return ret; +} + +#endif /* USE_ECONF */ |