123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #ifdef HAVE_CONFIG_H
- #include <config.h>
- #endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <security/pam_appl.h>
- #include <security/pam_misc.h>
- static struct pam_conv conv = {
- misc_conv,
- NULL
- };
- int main(int argc, char *argv[])
- {
- pam_handle_t *pamh=NULL;
- char *tst_arg = NULL;
- int retval;
- if (argc > 1)
- tst_arg = argv[1];
- retval = pam_start(tst_arg, NULL, &conv, &pamh);
- retval = pam_open_session(pamh, 0);
- retval = pam_close_session(pamh, 0);
- if (pam_end(pamh,retval) != PAM_SUCCESS) {
- pamh = NULL;
- exit(1);
- }
- return ( retval == PAM_SUCCESS ? 0:1 );
- }
|