summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-31 08:49:13 +1100
committerDamien Miller <djm@mindrot.org>1999-12-31 08:49:13 +1100
commit8eb0fd6d6fee368ff0c3de479b0c18763fe3ea3a (patch)
tree274f73a6e3c7272b0a22892078b564561e886d37 /auth-passwd.c
parent8bdeee25f8c0215812cdcdbd24f8c5b308a7b76a (diff)
downloadopenssh-git-8eb0fd6d6fee368ff0c3de479b0c18763fe3ea3a.tar.gz
- Fix password support on systems with a mixture of shadowed and
non-shadowed passwords (e.g. NIS). Report and fix from HARUYAMA Seigo <haruyama@nt.phys.s.u-tokyo.ac.jp>
Diffstat (limited to 'auth-passwd.c')
-rw-r--r--auth-passwd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/auth-passwd.c b/auth-passwd.c
index e91893ae..c3347030 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -11,7 +11,7 @@
#ifndef USE_PAM
-RCSID("$Id: auth-passwd.c,v 1.13 1999/12/29 22:48:15 damien Exp $");
+RCSID("$Id: auth-passwd.c,v 1.14 1999/12/30 21:49:13 damien Exp $");
#include "packet.h"
#include "ssh.h"
@@ -76,14 +76,14 @@ auth_password(struct passwd * pw, const char *password)
#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
spw = getspnam(pw->pw_name);
- if (spw == NULL)
- return(0);
+ if (spw != NULL)
+ {
+ /* Check for users with no password. */
+ if (strcmp(password, "") == 0 && strcmp(spw->sp_pwdp, "") == 0)
+ return 1;
- /* Check for users with no password. */
- if (strcmp(password, "") == 0 && strcmp(spw->sp_pwdp, "") == 0)
- return 1;
-
- pw_password = spw->sp_pwdp;
+ pw_password = spw->sp_pwdp;
+ }
#endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */
if (pw_password[0] != '\0')