]> andersk Git - openssh.git/blobdiff - auth-passwd.c
Attempt to clean up PAM code
[openssh.git] / auth-passwd.c
index a1cffba3c63df9e38478d6261b0e55ae467d0e18..27d2818a9e32ce7bc3e2c26796b4500f70308e28 100644 (file)
@@ -26,14 +26,6 @@ RCSID("$Id$");
 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 */
 }
This page took 0.033235 seconds and 4 git commands to generate.