summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-16 15:10:45 +1100
committerDamien Miller <djm@mindrot.org>1999-12-16 15:10:45 +1100
commit8f9d5073d8bed2c15843eb0c374b70b4c9486605 (patch)
tree5925864e2f353e76dd178a9576381d3218524c77 /auth-passwd.c
parent217ab302d8a389bdcb9fec8685556dadfceb1c86 (diff)
downloadopenssh-git-8f9d5073d8bed2c15843eb0c374b70b4c9486605.tar.gz
- Correctly handle empty passwords in shadow file. Patch from:V_1_2_1_PRE18
"Chris, the Young One" <cky@pobox.com>
Diffstat (limited to 'auth-passwd.c')
-rw-r--r--auth-passwd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/auth-passwd.c b/auth-passwd.c
index efae0fd2..d197840e 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -11,7 +11,7 @@
#ifndef HAVE_PAM
-RCSID("$Id: auth-passwd.c,v 1.8 1999/12/06 00:47:28 damien Exp $");
+RCSID("$Id: auth-passwd.c,v 1.9 1999/12/16 04:10:45 damien Exp $");
#include "packet.h"
#include "ssh.h"
@@ -76,6 +76,10 @@ auth_password(struct passwd * pw, const char *password)
if ((spw->sp_namp == NULL) || (strcmp(pw->pw_name, spw->sp_namp) != 0))
fatal("Shadow lookup returned garbage.");
+ /* Check for users with no password. */
+ if (strcmp(password, "") == 0 && strcmp(spw->sp_pwdp, "") == 0)
+ return 1;
+
if (strlen(spw->sp_pwdp) < 3)
return(0);