diff options
author | Damien Miller <djm@mindrot.org> | 1999-10-27 23:42:05 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-10-27 23:42:05 +1000 |
commit | 332e67fde27c4017d2df8dafe05a55be3c7597cd (patch) | |
tree | 3c973d134c785a840e2f0c56aea886d8fa6f6b96 /auth-passwd.c | |
parent | 726a5b3be128911d2f38f73a6a8c9be6dde9bb3a (diff) | |
download | openssh-git-332e67fde27c4017d2df8dafe05a55be3c7597cd.tar.gz |
Attempt to clean up PAM code
Use PWDB getpw* functions if HAVE_PWDB defined
Minor other tidyups
Diffstat (limited to 'auth-passwd.c')
-rw-r--r-- | auth-passwd.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/auth-passwd.c b/auth-passwd.c index 7d684678..61f66fed 100644 --- a/auth-passwd.c +++ b/auth-passwd.c @@ -15,7 +15,7 @@ the password is valid for the user. */ #include "includes.h" -RCSID("$Id: auth-passwd.c,v 1.1 1999/10/27 03:42:43 damien Exp $"); +RCSID("$Id: auth-passwd.c,v 1.2 1999/10/27 13:42:05 damien Exp $"); #include "packet.h" #include "ssh.h" @@ -26,14 +26,6 @@ RCSID("$Id: auth-passwd.c,v 1.1 1999/10/27 03:42:43 damien Exp $"); extern char *ticket; #endif /* KRB4 */ -#ifdef HAVE_PAM -#include <security/pam_appl.h> -extern pam_handle_t *pamh; -extern int retval; -extern char* pampasswd; -extern int origretval; -#endif /* HAVE_PAM */ - /* Tries to authenticate the user using password. Returns true if authentication succeeds. */ @@ -58,26 +50,6 @@ int auth_password(struct passwd *pw, const char *password) if (pw == NULL) return 0; -#ifdef HAVE_PAM - retval = origretval; - - pampasswd = xstrdup(password); - - if (retval == PAM_SUCCESS) - retval = pam_authenticate ((pam_handle_t *)pamh, 0); - - if (retval == PAM_SUCCESS) - retval = pam_acct_mgmt ((pam_handle_t *)pamh, 0); - - xfree(pampasswd); - - if (retval == PAM_SUCCESS) - retval = pam_open_session ((pam_handle_t *)pamh, 0); - - return (retval == PAM_SUCCESS); - -#else /* HAVE_PAM */ - #ifdef SKEY if (options.skey_authentication == 1) { if (strncasecmp(password, "s/key", 5) == 0) { @@ -205,5 +177,4 @@ int auth_password(struct passwd *pw, const char *password) /* Authentication is accepted if the encrypted passwords are identical. */ return (strcmp(encrypted_password, pw->pw_passwd) == 0); -#endif /* HAVE_PAM */ } |