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 | |
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')
-rw-r--r-- | libpam/pam_modutil_searchkey.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libpam/pam_modutil_searchkey.c b/libpam/pam_modutil_searchkey.c index 5480db1d..ccf2461f 100644 --- a/libpam/pam_modutil_searchkey.c +++ b/libpam/pam_modutil_searchkey.c @@ -14,7 +14,7 @@ #include <stdlib.h> #include <ctype.h> #ifdef USE_ECONF -#include <libeconf.h> +#include "pam_econf.h" #endif #ifdef USE_ECONF @@ -29,10 +29,14 @@ econf_search_key (const char *name, const char *suffix, const char *key) { econf_file *key_file = NULL; char *val; + econf_err error; - if (econf_readDirs (&key_file, VENDORDIR, SYSCONFDIR, name, suffix, - " \t", "#")) - return NULL; + error = pam_econf_readconfig (&key_file, VENDORDIR, SYSCONFDIR, name, suffix, + " \t", "#", NULL, NULL); + if (error != ECONF_SUCCESS) { + econf_free (key_file); + return NULL; + } if (econf_getStringValue (key_file, NULL, key, &val)) { econf_free (key_file); |