From e31f60c475bed515bad9bbb6e532653eb732ca28 Mon Sep 17 00:00:00 2001 From: Seraphim Mellos Date: Mon, 16 Jun 2008 22:57:28 +0300 Subject: Added logging/debug msgs in pam_unix --- modules/pam_unix/pam_unix.c | 6 +++--- modules/pam_unix/pam_unix.c~ | 15 ++++----------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/modules/pam_unix/pam_unix.c b/modules/pam_unix/pam_unix.c index 2be7e75..ae824f5 100644 --- a/modules/pam_unix/pam_unix.c +++ b/modules/pam_unix/pam_unix.c @@ -18,6 +18,7 @@ #ifndef __linux__ #include /* for BSD login classes */ +#include /* libutil functions */ #else #include /* for linux boxes */ #endif @@ -64,7 +65,6 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, PAM_LOG("Authenticating user: [%s]", user); - puts("USER GOT"); /* get password */ if (pwd != NULL) { @@ -73,7 +73,8 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, if (pass[0] == '\0') { if (!(flags & PAM_DISALLOW_NULL_AUTHTOK) && openpam_get_option(pamh, PAM_OPT_NULLOK)){ - PAM_LOG("User [%s] has empty password. Authentication succesfull."); + PAM_LOG("User [%s] has empty password. \ + Authentication succesfull.", user); return (PAM_SUCCESS); } @@ -124,7 +125,6 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, pam_err = PAM_AUTH_ERR; } else { PAM_LOG("Authentication completed succesfully."); - puts("SUCCESS!"); pam_err = PAM_SUCCESS; } diff --git a/modules/pam_unix/pam_unix.c~ b/modules/pam_unix/pam_unix.c~ index 601aa89..79e1131 100644 --- a/modules/pam_unix/pam_unix.c~ +++ b/modules/pam_unix/pam_unix.c~ @@ -64,7 +64,6 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, PAM_LOG("Authenticating user: [%s]", user); - puts("USER GOT"); /* get password */ if (pwd != NULL) { @@ -73,22 +72,17 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, if (pass[0] == '\0') { if (!(flags & PAM_DISALLOW_NULL_AUTHTOK) && openpam_get_option(pamh, PAM_OPT_NULLOK)){ - PAM_LOG("User [%s] has empty password. Authentication succesfull."); + PAM_LOG("User [%s] has empty password. \ + Authentication succesfull.", user); return (PAM_SUCCESS); } real_hash = "*"; } - /* - * Dummy authentication is something that the freebsd-lib - * people have implemented. Not sure whether it's needed on - * Linux -or BSD- but it'll be left as is for compatibiity - * issues. Need to be checked! - */ - +#ifndef __linux__ lc = login_getpwclass(pwd); - +#endif } else { PAM_LOG("Doing dummy authentication."); real_hash = "*"; @@ -130,7 +124,6 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, pam_err = PAM_AUTH_ERR; } else { PAM_LOG("Authentication completed succesfully."); - puts("SUCCESS!"); pam_err = PAM_SUCCESS; } -- cgit v1.2.3-65-gdbad