diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2001-12-09 22:51:12 +0000 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2001-12-09 22:51:12 +0000 |
commit | 2acda542874f720091f6bfcb7aad09e35a8b2375 (patch) | |
tree | 6d9a5e3342ed86a65033576131096b867c214e9b /dynamic/test.c | |
parent | 97c9cd159d080814e56508fcc4ad0032f5f8023c (diff) | |
download | pam-2acda542874f720091f6bfcb7aad09e35a8b2375.tar.gz pam-2acda542874f720091f6bfcb7aad09e35a8b2375.tar.bz2 pam-2acda542874f720091f6bfcb7aad09e35a8b2375.zip |
Relevant BUGIDs: 232194
Purpose of commit: new feature
Commit summary:
---------------
If you are looking for an object that you can blindly dlopen() and
use to bind to pam w/ modules, this commit is for you. Its not fully
integrated into the build tree, but I'd like some feedback before
wiring it in as a regular feature.
Diffstat (limited to 'dynamic/test.c')
-rw-r--r-- | dynamic/test.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/dynamic/test.c b/dynamic/test.c new file mode 100644 index 00000000..35496fe4 --- /dev/null +++ b/dynamic/test.c @@ -0,0 +1,27 @@ +#include <stdio.h> +#include <dlfcn.h> +#include <unistd.h> + +#include <security/pam_appl.h> +#include <security/pam_misc.h> + +int main(int argc, char **argv) +{ + void *handle; + + handle = dlopen("./pam.so", RTLD_NOW); + if (handle == NULL) { + fprintf(stderr, "failed to load pam.so: %s\n", dlerror()); + exit(1); + } + + /* handle->XXX points to each of the PAM functions */ + + + if (dlclose(handle)) { + fprintf(stderr, "failed to unload pam.so: %s\n", dlerror()); + exit(1); + } + + exit(0); +} |