diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-03-08 23:04:06 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-03-08 23:04:06 +1100 |
commit | dbf7a74ee569a9544276db42eb7aee1141072a24 (patch) | |
tree | f9aea6fab5efea9441557696611b04a065ad8128 /auth2.c | |
parent | 86c093d2895989d1258459b797ce3630eaa47d1a (diff) |
- (dtucker) [auth-pam.c auth-pam.h auth1.c auth2.c monitor.c monitor_wrap.c
monitor_wrap.h] Bug #808: Ensure force_pwchange is correctly initialized
even if keyboard-interactive is not used by the client. Prevents segfaults
in some cases where the user's password is expired (note this is not
considered a security exposure). ok djm@
Diffstat (limited to 'auth2.c')
-rw-r--r-- | auth2.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -150,24 +150,24 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) | |||
150 | if (authctxt->attempt++ == 0) { | 150 | if (authctxt->attempt++ == 0) { |
151 | /* setup auth context */ | 151 | /* setup auth context */ |
152 | authctxt->pw = PRIVSEP(getpwnamallow(user)); | 152 | authctxt->pw = PRIVSEP(getpwnamallow(user)); |
153 | authctxt->user = xstrdup(user); | ||
153 | if (authctxt->pw && strcmp(service, "ssh-connection")==0) { | 154 | if (authctxt->pw && strcmp(service, "ssh-connection")==0) { |
154 | authctxt->valid = 1; | 155 | authctxt->valid = 1; |
155 | debug2("input_userauth_request: setting up authctxt for %s", user); | 156 | debug2("input_userauth_request: setting up authctxt for %s", user); |
156 | #ifdef USE_PAM | 157 | #ifdef USE_PAM |
157 | if (options.use_pam) | 158 | if (options.use_pam) |
158 | PRIVSEP(start_pam(authctxt->pw->pw_name)); | 159 | PRIVSEP(start_pam(authctxt)); |
159 | #endif | 160 | #endif |
160 | } else { | 161 | } else { |
161 | logit("input_userauth_request: illegal user %s", user); | 162 | logit("input_userauth_request: illegal user %s", user); |
162 | authctxt->pw = fakepw(); | 163 | authctxt->pw = fakepw(); |
163 | #ifdef USE_PAM | 164 | #ifdef USE_PAM |
164 | if (options.use_pam) | 165 | if (options.use_pam) |
165 | PRIVSEP(start_pam(user)); | 166 | PRIVSEP(start_pam(authctxt)); |
166 | #endif | 167 | #endif |
167 | } | 168 | } |
168 | setproctitle("%s%s", authctxt->pw ? user : "unknown", | 169 | setproctitle("%s%s", authctxt->pw ? user : "unknown", |
169 | use_privsep ? " [net]" : ""); | 170 | use_privsep ? " [net]" : ""); |
170 | authctxt->user = xstrdup(user); | ||
171 | authctxt->service = xstrdup(service); | 171 | authctxt->service = xstrdup(service); |
172 | authctxt->style = style ? xstrdup(style) : NULL; | 172 | authctxt->style = style ? xstrdup(style) : NULL; |
173 | if (use_privsep) | 173 | if (use_privsep) |