diff options
author | peter <peter@FreeBSD.org> | 2001-06-14 01:13:30 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-06-14 01:13:30 +0000 |
commit | dcb44533751f48e5713899337277e3c585847c04 (patch) | |
tree | 97a0e00d2f54c7ad6ef0aa58a36739093e2a2b12 /contrib | |
parent | 3979a82a111d0d9b1fcc24137b7826d4eba0de01 (diff) | |
download | FreeBSD-src-dcb44533751f48e5713899337277e3c585847c04.zip FreeBSD-src-dcb44533751f48e5713899337277e3c585847c04.tar.gz |
Fix libpam's linker set stuff to use the new API (unbreak world), and get
rid of gensetdefs from here as well.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/libpam/libpam/pam_static.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/libpam/libpam/pam_static.c b/contrib/libpam/libpam/pam_static.c index aac3e99..e511a77 100644 --- a/contrib/libpam/libpam/pam_static.c +++ b/contrib/libpam/libpam/pam_static.c @@ -16,7 +16,7 @@ #ifdef PAM_STATIC -extern struct linker_set _pam_static_modules; +SET_DECLARE(_pam_static_modules, struct pam_module); /* Return pointer to data structure used to define a static module */ struct pam_module * _pam_open_static_handler(const char *path) @@ -24,8 +24,7 @@ struct pam_module * _pam_open_static_handler(const char *path) int i; const char *clpath = path; char *lpath, *end; - struct pam_module **static_modules = - (struct pam_module **)_pam_static_modules.ls_items; + struct pam_module **static_module; if (strchr(clpath, '/')) { /* ignore path and leading "/" */ @@ -41,16 +40,17 @@ struct pam_module * _pam_open_static_handler(const char *path) } /* now go find the module */ - for (i = 0; static_modules[i] != NULL; i++) { - D(("%s=?%s\n", lpath, static_modules[i]->name)); - if (static_modules[i]->name && - ! strcmp(static_modules[i]->name, lpath)) { - break; + SET_FOREACH(static_module, _pam_static_modules) { + D(("%s=?%s\n", lpath, (*static_module)->name)); + if ((*static_module)->name && + ! strcmp((*static_module)->name, lpath)) { + free(lpath); + return (*static_module); } } free(lpath); - return (static_modules[i]); + return (NULL); } /* Return pointer to function requested from static module |