diff options
author | Damien Miller <djm@mindrot.org> | 2000-05-20 15:02:59 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-05-20 15:02:59 +1000 |
commit | dfc83f42eba83d6dd127ce36fb33a490163c32de (patch) | |
tree | 8da6dce300467bc31e4fea7c4bda0c3181d24bbb /auth-passwd.c | |
parent | ad1bc5f986ac31ea3f429d2c49d7f34bd78e32fc (diff) | |
download | openssh-git-dfc83f42eba83d6dd127ce36fb33a490163c32de.tar.gz |
- SunOS 4.x support from Todd C. Miller <Todd.Miller@courtesan.com>
Diffstat (limited to 'auth-passwd.c')
-rw-r--r-- | auth-passwd.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/auth-passwd.c b/auth-passwd.c index e64e6568..b27c5bae 100644 --- a/auth-passwd.c +++ b/auth-passwd.c @@ -11,7 +11,7 @@ #ifndef USE_PAM -RCSID("$Id: auth-passwd.c,v 1.19 2000/04/29 14:47:29 damien Exp $"); +RCSID("$Id: auth-passwd.c,v 1.20 2000/05/20 05:03:00 damien Exp $"); #include "packet.h" #include "ssh.h" @@ -28,6 +28,11 @@ RCSID("$Id: auth-passwd.c,v 1.19 2000/04/29 14:47:29 damien Exp $"); #ifdef HAVE_SHADOW_H # include <shadow.h> #endif +#ifdef HAVE_GETPWANAM +# include <sys/label.h> +# include <sys/audit.h> +# include <pwdadj.h> +#endif #if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) # include "md5crypt.h" #endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */ @@ -46,6 +51,9 @@ auth_password(struct passwd * pw, const char *password) #ifdef HAVE_SHADOW_H struct spwd *spw; #endif +#ifdef HAVE_GETPWANAM + struct passwd_adjunct *spw; +#endif #ifdef WITH_AIXAUTHENTICATE char *authmsg; char *loginmsg; @@ -99,6 +107,16 @@ auth_password(struct passwd * pw, const char *password) pw_password = spw->sp_pwdp; } #endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */ +#if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) + if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL) + { + /* Check for users with no password. */ + if (strcmp(password, "") == 0 && strcmp(spw->pwa_passwd, "") == 0) + return 1; + + pw_password = spw->pwa_passwd; + } +#endif /* defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) */ if (pw_password[0] != '\0') salt = pw_password; |