diff options
author | Marvin Borner | 2022-07-13 15:12:27 +0200 |
---|---|---|
committer | Marvin Borner | 2022-07-13 15:13:00 +0200 |
commit | 3e8f62c35fce80343b5359b45924f7bc3fc22d4f (patch) | |
tree | e80d8b8bed961e8381491ff52f50d4f0c34f5904 /main.c |
Initial commit
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 49 |
1 files changed, 49 insertions, 0 deletions
@@ -0,0 +1,49 @@ +#include <security/pam_modules.h> +#include <security/pam_ext.h> +#include <unistd.h> +#include <stdio.h> +#include <sys/wait.h> + +PAM_EXTERN int pam_sm_authenticate(pam_handle_t *handle, int flags, int argc, + const char **argv) +{ + if (fork() == 0) { + execl("/etc/security/ishome", NULL); + } else { + int stat; + wait(&stat); + if (WIFEXITED(stat) && WEXITSTATUS(stat) == 0) + return PAM_SUCCESS; + } + return PAM_ABORT; +} + +PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, + const char **argv) +{ + return PAM_SUCCESS; +} + +PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, + const char **argv) +{ + return PAM_SUCCESS; +} + +PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, + const char **argv) +{ + return PAM_SUCCESS; +} + +PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, + const char **argv) +{ + return PAM_SUCCESS; +} + +PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, + const char **argv) +{ + return PAM_SUCCESS; +} |