]> andersk Git - openssh.git/blobdiff - auth-passwd.c
- djm@cvs.openbsd.org 2004/08/11 12:01:16
[openssh.git] / auth-passwd.c
index d12996bba46d49f0a8907794dd0a5ce61ad5e756..7a68e05628616446747ae392972e3305e0b051e7 100644 (file)
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-passwd.c,v 1.30 2003/11/04 08:54:09 djm Exp $");
+RCSID("$OpenBSD: auth-passwd.c,v 1.31 2004/01/30 09:48:57 markus Exp $");
 
 #include "packet.h"
 #include "log.h"
 #include "servconf.h"
 #include "auth.h"
 #include "auth-options.h"
-#ifdef WITH_AIXAUTHENTICATE
-# include "canohost.h"
-#endif
 
 extern ServerOptions options;
 int sys_auth_passwd(Authctxt *, const char *);
 
-static void
+void
 disable_forwarding(void)
 {
        no_port_forwarding_flag = 1;
@@ -67,6 +64,9 @@ auth_password(Authctxt *authctxt, const char *password)
 {
        struct passwd * pw = authctxt->pw;
        int ok = authctxt->valid;
+#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
+       static int expire_checked = 0;
+#endif
 
 #ifndef HAVE_CYGWIN
        if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
@@ -75,13 +75,6 @@ auth_password(Authctxt *authctxt, const char *password)
        if (*password == '\0' && options.permit_empty_passwd == 0)
                return 0;
 
-#if defined(HAVE_OSF_SIA)
-       /*
-        * XXX: any reason this is before krb?  could be moved to
-        * sys_auth_passwd()?  -dt
-        */
-       return auth_sia_password(authctxt, password) && ok;
-#endif
 #ifdef KRB5
        if (options.kerberos_authentication == 1) {
                int ret = auth_krb5_password(authctxt, password);
@@ -100,6 +93,20 @@ auth_password(Authctxt *authctxt, const char *password)
                return ok;
        }
 #endif
+#ifdef USE_PAM
+       if (options.use_pam)
+               return (sshpam_auth_passwd(authctxt, password) && ok);
+#endif
+#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
+       if (!expire_checked) {
+               expire_checked = 1;
+               if (auth_shadow_pwexpired(authctxt)) {
+                       disable_forwarding();
+                       authctxt->force_pwchange = 1;
+               }
+       }
+#endif
+               
        return (sys_auth_passwd(authctxt, password) && ok);
 }
 
@@ -121,14 +128,7 @@ sys_auth_passwd(Authctxt *authctxt, const char *password)
                return (auth_close(as));
        }
 }
-#elif defined(WITH_AIXAUTHENTICATE)
-int
-sys_auth_passwd(Authctxt *authctxt, const char *password)
-{
-       return (aix_authenticate(authctxt->pw->pw_name, password,
-           get_canonical_hostname(options.use_dns)));
-}
-#else
+#elif !defined(CUSTOM_SYS_AUTH_PASSWD)
 int
 sys_auth_passwd(Authctxt *authctxt, const char *password)
 {
This page took 0.034666 seconds and 4 git commands to generate.