aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeraphim Mellos <mellos@ceid.upatras.gr>2008-06-12 16:11:02 +0300
committerSeraphim Mellos <mellos@ceid.upatras.gr>2008-06-12 16:11:02 +0300
commit673fc8cc88ee52064d8261177c7ae98addae7231 (patch)
treea1889abf7e423fdf54e56e8e9a8693afa449d0bd
parentAdded pam_mod_misc.h as a test (diff)
downloadopenpam-modules-673fc8cc88ee52064d8261177c7ae98addae7231.tar.gz
openpam-modules-673fc8cc88ee52064d8261177c7ae98addae7231.tar.bz2
openpam-modules-673fc8cc88ee52064d8261177c7ae98addae7231.zip
Minor fixes in pam_unix
-rw-r--r--src/pam_unix/pam_unix.c12
-rw-r--r--src/pam_unix/pam_unix.c~14
-rw-r--r--src/pam_unix/pam_unix.obin5188 -> 5484 bytes
-rwxr-xr-xsrc/pam_unix/pam_unix.so.1bin9153 -> 0 bytes
4 files changed, 11 insertions, 15 deletions
diff --git a/src/pam_unix/pam_unix.c b/src/pam_unix/pam_unix.c
index 2791783..50e305d 100644
--- a/src/pam_unix/pam_unix.c
+++ b/src/pam_unix/pam_unix.c
@@ -5,12 +5,6 @@
#include <sys/types.h>
#include <unistd.h>
-#define PAM_OPT_NULLOK "nullok"
-#define PAM_OPT_AUTH_AS_SELF "auth_as_self"
-#define PAM_OPT_ECHO_PASS "echo_pass"
-#define PAM_OPT_DEBUG "debug"
-
-
#ifndef MAXHOSTNAMELEN
# define MAXHOSTNAMELEN 256
@@ -22,6 +16,7 @@
#endif
#include <security/pam_modules.h>
+#include <pam_mod_misc.h>
#include <security/pam_appl.h>
@@ -38,11 +33,13 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags,
int pam_err;
/* identify user */
-
+
if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) {
+ PAM_LOG("Authenticating as self");
pwd = getspnam(getlogin());
} else {
if ((pam_err = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
+ PAM_LOG("Authenticating with uname %s", user);
return (pam_err);
pwd = getspnam(user);
@@ -224,3 +221,4 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags ,
}
+PAM_MODULE_ENTRY("pam_unix")
diff --git a/src/pam_unix/pam_unix.c~ b/src/pam_unix/pam_unix.c~
index 598ab02..50e305d 100644
--- a/src/pam_unix/pam_unix.c~
+++ b/src/pam_unix/pam_unix.c~
@@ -5,12 +5,6 @@
#include <sys/types.h>
#include <unistd.h>
-#define PAM_OPT_NULLOK "nullok"
-#define PAM_OPT_AUTH_AS_SELF "auth_as_self"
-#define PAM_OPT_ECHO_PASS "echo_pass"
-#define PAM_OPT_DEBUG "debug"
-
-
#ifndef MAXHOSTNAMELEN
# define MAXHOSTNAMELEN 256
@@ -22,6 +16,7 @@
#endif
#include <security/pam_modules.h>
+#include <pam_mod_misc.h>
#include <security/pam_appl.h>
@@ -38,11 +33,13 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags,
int pam_err;
/* identify user */
-
+
if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) {
+ PAM_LOG("Authenticating as self");
pwd = getspnam(getlogin());
} else {
if ((pam_err = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
+ PAM_LOG("Authenticating with uname %s", user);
return (pam_err);
pwd = getspnam(user);
@@ -184,7 +181,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags ,
}
if (pwd->sp_lstchg == 0 ) {
- return (PAM_NEW_AUTHTOK_REQD)
+ return (PAM_NEW_AUTHTOK_REQD);
}
/* check all other possibilities (mostly stolen from pam_tcb) */
@@ -224,3 +221,4 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags ,
}
+PAM_MODULE_ENTRY("pam_unix")
diff --git a/src/pam_unix/pam_unix.o b/src/pam_unix/pam_unix.o
index 15ea754..61cf162 100644
--- a/src/pam_unix/pam_unix.o
+++ b/src/pam_unix/pam_unix.o
Binary files differ
diff --git a/src/pam_unix/pam_unix.so.1 b/src/pam_unix/pam_unix.so.1
deleted file mode 100755
index 7d4bc44..0000000
--- a/src/pam_unix/pam_unix.so.1
+++ /dev/null
Binary files differ