diff options
author | Damien Miller <djm@mindrot.org> | 2003-05-10 19:28:02 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-05-10 19:28:02 +1000 |
commit | 4f9f42a9bb6a6aa8f6100d873dc6344f2f9994de (patch) | |
tree | f81c39146e1cfabb4b198f57f60453b2dcaac299 /auth-passwd.c | |
parent | c437cda328b4733b59a7ed028b72e6b7f58f86e6 (diff) |
- (djm) Merge FreeBSD PAM code: replaces PAM password auth kludge with
proper challenge-response module
Diffstat (limited to 'auth-passwd.c')
-rw-r--r-- | auth-passwd.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/auth-passwd.c b/auth-passwd.c index 62ea3a52d..b893165bf 100644 --- a/auth-passwd.c +++ b/auth-passwd.c | |||
@@ -43,8 +43,8 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $"); | |||
43 | #include "servconf.h" | 43 | #include "servconf.h" |
44 | #include "auth.h" | 44 | #include "auth.h" |
45 | 45 | ||
46 | #if !defined(USE_PAM) && !defined(HAVE_OSF_SIA) | 46 | #if !defined(HAVE_OSF_SIA) |
47 | /* Don't need any of these headers for the PAM or SIA cases */ | 47 | /* Don't need any of these headers for the SIA cases */ |
48 | # ifdef HAVE_CRYPT_H | 48 | # ifdef HAVE_CRYPT_H |
49 | # include <crypt.h> | 49 | # include <crypt.h> |
50 | # endif | 50 | # endif |
@@ -78,7 +78,7 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $"); | |||
78 | # include <sys/cygwin.h> | 78 | # include <sys/cygwin.h> |
79 | # define is_winnt (GetVersion() < 0x80000000) | 79 | # define is_winnt (GetVersion() < 0x80000000) |
80 | # endif | 80 | # endif |
81 | #endif /* !USE_PAM && !HAVE_OSF_SIA */ | 81 | #endif /* !HAVE_OSF_SIA */ |
82 | 82 | ||
83 | extern ServerOptions options; | 83 | extern ServerOptions options; |
84 | #ifdef WITH_AIXAUTHENTICATE | 84 | #ifdef WITH_AIXAUTHENTICATE |
@@ -94,7 +94,7 @@ auth_password(Authctxt *authctxt, const char *password) | |||
94 | { | 94 | { |
95 | struct passwd * pw = authctxt->pw; | 95 | struct passwd * pw = authctxt->pw; |
96 | int ok = authctxt->valid; | 96 | int ok = authctxt->valid; |
97 | #if !defined(USE_PAM) && !defined(HAVE_OSF_SIA) | 97 | #if !defined(HAVE_OSF_SIA) |
98 | char *encrypted_password; | 98 | char *encrypted_password; |
99 | char *pw_password; | 99 | char *pw_password; |
100 | char *salt; | 100 | char *salt; |
@@ -112,7 +112,7 @@ auth_password(Authctxt *authctxt, const char *password) | |||
112 | int authsuccess; | 112 | int authsuccess; |
113 | int reenter = 1; | 113 | int reenter = 1; |
114 | # endif | 114 | # endif |
115 | #endif /* !defined(USE_PAM) && !defined(HAVE_OSF_SIA) */ | 115 | #endif /* !defined(HAVE_OSF_SIA) */ |
116 | 116 | ||
117 | /* deny if no user. */ | 117 | /* deny if no user. */ |
118 | if (pw == NULL) | 118 | if (pw == NULL) |
@@ -124,9 +124,7 @@ auth_password(Authctxt *authctxt, const char *password) | |||
124 | if (*password == '\0' && options.permit_empty_passwd == 0) | 124 | if (*password == '\0' && options.permit_empty_passwd == 0) |
125 | ok = 0; | 125 | ok = 0; |
126 | 126 | ||
127 | #if defined(USE_PAM) | 127 | #if defined(HAVE_OSF_SIA) |
128 | return auth_pam_password(authctxt, password) && ok; | ||
129 | #elif defined(HAVE_OSF_SIA) | ||
130 | if (!ok) | 128 | if (!ok) |
131 | return 0; | 129 | return 0; |
132 | return auth_sia_password(authctxt, password); | 130 | return auth_sia_password(authctxt, password); |
@@ -235,5 +233,5 @@ auth_password(Authctxt *authctxt, const char *password) | |||
235 | 233 | ||
236 | /* Authentication is accepted if the encrypted passwords are identical. */ | 234 | /* Authentication is accepted if the encrypted passwords are identical. */ |
237 | return (strcmp(encrypted_password, pw_password) == 0); | 235 | return (strcmp(encrypted_password, pw_password) == 0); |
238 | #endif /* !USE_PAM && !HAVE_OSF_SIA */ | 236 | #endif /* !HAVE_OSF_SIA */ |
239 | } | 237 | } |