diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2002-05-24 16:45:17 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2002-05-24 16:45:17 +0000 |
commit | 53cab32a9208921ca8843c1e2550007ffc7b8b86 (patch) | |
tree | 2775b38b6d526b93eb082ba26f89368026573495 /usr.bin/ssh | |
parent | 82901bffaf0b0e093e8ad08939556bc20de0d384 (diff) |
don't include unused code in the #ifdef BSD_AUTH case; ok markus@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/auth-passwd.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/usr.bin/ssh/auth-passwd.c b/usr.bin/ssh/auth-passwd.c index edb79bcfe5b..d0295fb5b78 100644 --- a/usr.bin/ssh/auth-passwd.c +++ b/usr.bin/ssh/auth-passwd.c @@ -36,7 +36,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-passwd.c,v 1.26 2002/05/10 02:30:12 mouring Exp $"); +RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $"); #include "packet.h" #include "log.h" @@ -54,7 +54,6 @@ int auth_password(Authctxt *authctxt, const char *password) { struct passwd * pw = authctxt->pw; - char *encrypted_password; /* deny if no user. */ if (pw == NULL) @@ -85,14 +84,20 @@ auth_password(Authctxt *authctxt, const char *password) return 0; else return 1; -#endif +#else /* Check for users with no password. */ if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0) return 1; - /* Encrypt the candidate password using the proper salt. */ - encrypted_password = crypt(password, - (pw->pw_passwd[0] && pw->pw_passwd[1]) ? pw->pw_passwd : "xx"); - - /* Authentication is accepted if the encrypted passwords are identical. */ - return (strcmp(encrypted_password, pw->pw_passwd) == 0); + else { + /* Encrypt the candidate password using the proper salt. */ + char *encrypted_password = crypt(password, + (pw->pw_passwd[0] && pw->pw_passwd[1]) ? + pw->pw_passwd : "xx"); + /* + * Authentication is accepted if the encrypted passwords + * are identical. + */ + return (strcmp(encrypted_password, pw->pw_passwd) == 0); + } +#endif } |