diff options
| -rw-r--r-- | Makefile | 13 | ||||
| -rw-r--r-- | README.txt | 1 | ||||
| -rw-r--r-- | check_user.c | 49 |
3 files changed, 13 insertions, 50 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cf47386 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +CC = gcc +CFLAGS += `pkg-config --cflags gtk+-2.0 --cflags` +LIBS += `pkg-config --libs gtk+-2.0 --libs` +LIBS += -lpam -lpam_misc + +capu : ui-login.o + ${CC} ${CFLAGS} ${LIBS} -o capu ui-login.o + +ui-login.o : ui-login.c + ${CC} ${CFLAGS} ${LIBS} -c ui-login.c + +clean : + rm capu ui-login.o diff --git a/README.txt b/README.txt deleted file mode 100644 index fb2f9a4..0000000 --- a/README.txt +++ /dev/null @@ -1 +0,0 @@ -Control de Acesso Perimentro Universal diff --git a/check_user.c b/check_user.c deleted file mode 100644 index 5f50aa9..0000000 --- a/check_user.c +++ /dev/null @@ -1,49 +0,0 @@ -#include <security/pam_appl.h> -#include <security/pam_misc.h> -#include <stdio.h> - -static struct pam_conv conv = { - misc_conv, - NULL -}; - -int main (int argc, char *argv[]) -{ - pam_handle_t *pamh=NULL; - int retval; - const char *user = "lucas"; - - if (argc == 2) { - user = argv[1]; - } - - if (argc > 2) { - fprintf(stderr, "Usage: check_user [username]\n"); - exit(1); - } - - retval = pam_start("check_user", user, &conv, &pamh); - if (retval == PAM_SUCCESS) { - retval = pam_authenticate(pamh, 0); - } - - if (retval == PAM_SUCCESS) { - retval = pam_acct_mgmt(pamh, 0); - } - - if (retval == PAM_SUCCESS) { - fprintf(stdout, "Authenticated\n"); - } else { - fprintf(stdout, "Not Authenticated\n"); - } - - if (pam_end (pamh,retval) != PAM_SUCCESS) { - pamh = NULL; - fprintf (stderr, "check_user: failed to release authenticator\n"); - exit(1); - } - - return (retval == PAM_SUCCESS ? 0:1 ); - -} - |
