aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeraphim Mellos <mellos@ceid.upatras.gr>2008-06-16 22:57:28 +0300
committerSeraphim Mellos <mellos@ceid.upatras.gr>2008-06-18 17:47:16 +0300
commite31f60c475bed515bad9bbb6e532653eb732ca28 (patch)
tree7f3b8f7c2d8ae2c5815c263daf1c2766cd016aa4 /modules/pam_unix
parentFixed a bug with dummy authentication in pam_unix (diff)
downloadopenpam-modules-e31f60c475bed515bad9bbb6e532653eb732ca28.tar.gz
openpam-modules-e31f60c475bed515bad9bbb6e532653eb732ca28.tar.bz2
openpam-modules-e31f60c475bed515bad9bbb6e532653eb732ca28.zip
Added logging/debug msgs in pam_unix
Diffstat (limited to 'modules/pam_unix')
-rw-r--r--modules/pam_unix/pam_unix.c6
-rw-r--r--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 <login_cap.h> /* for BSD login classes */
+#include <util.h> /* libutil functions */
#else
#include <shadow.h> /* 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;
}