]> granicus.if.org Git - linux-pam/blob - dynamic/test.c
35496fe46ce075a8935001cb3812fe800de9cec1
[linux-pam] / dynamic / test.c
1 #include <stdio.h>
2 #include <dlfcn.h>
3 #include <unistd.h>
4
5 #include <security/pam_appl.h>
6 #include <security/pam_misc.h>
7
8 int main(int argc, char **argv)
9 {
10     void *handle;
11
12     handle = dlopen("./pam.so", RTLD_NOW);
13     if (handle == NULL) {
14         fprintf(stderr, "failed to load pam.so: %s\n", dlerror());
15         exit(1);
16     }
17
18     /* handle->XXX points to each of the PAM functions */
19     
20     
21     if (dlclose(handle)) {
22         fprintf(stderr, "failed to unload pam.so: %s\n", dlerror());
23         exit(1);
24     }
25
26     exit(0);
27 }