diff options
author | 2008-06-12 16:11:02 +0300 | |
---|---|---|
committer | 2008-06-12 16:11:02 +0300 | |
commit | 673fc8cc88ee52064d8261177c7ae98addae7231 (patch) | |
tree | a1889abf7e423fdf54e56e8e9a8693afa449d0bd | |
parent | Added pam_mod_misc.h as a test (diff) | |
download | openpam-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.c | 12 | ||||
-rw-r--r-- | src/pam_unix/pam_unix.c~ | 14 | ||||
-rw-r--r-- | src/pam_unix/pam_unix.o | bin | 5188 -> 5484 bytes | |||
-rwxr-xr-x | src/pam_unix/pam_unix.so.1 | bin | 9153 -> 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 Binary files differindex 15ea754..61cf162 100644 --- a/src/pam_unix/pam_unix.o +++ b/src/pam_unix/pam_unix.o diff --git a/src/pam_unix/pam_unix.so.1 b/src/pam_unix/pam_unix.so.1 Binary files differdeleted file mode 100755 index 7d4bc44..0000000 --- a/src/pam_unix/pam_unix.so.1 +++ /dev/null |