Deleted Added
full compact
auth2.c (149753) auth2.c (157019)
1/*
2 * Copyright (c) 2000 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
26RCSID("$OpenBSD: auth2.c,v 1.107 2004/07/28 09:40:29 markus Exp $");
1/*
2 * Copyright (c) 2000 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
26RCSID("$OpenBSD: auth2.c,v 1.107 2004/07/28 09:40:29 markus Exp $");
27RCSID("$FreeBSD: head/crypto/openssh/auth2.c 149753 2005-09-03 07:04:25Z des $");
27RCSID("$FreeBSD: head/crypto/openssh/auth2.c 157019 2006-03-22 20:41:37Z des $");
28
29#include "canohost.h"
30#include "ssh2.h"
31#include "xmalloc.h"
32#include "packet.h"
33#include "log.h"
34#include "servconf.h"
35#include "compat.h"

--- 124 unchanged lines hidden (view full) ---

160
161 if (authctxt->attempt++ == 0) {
162 /* setup auth context */
163 authctxt->pw = PRIVSEP(getpwnamallow(user));
164 authctxt->user = xstrdup(user);
165 if (authctxt->pw && strcmp(service, "ssh-connection")==0) {
166 authctxt->valid = 1;
167 debug2("input_userauth_request: setting up authctxt for %s", user);
28
29#include "canohost.h"
30#include "ssh2.h"
31#include "xmalloc.h"
32#include "packet.h"
33#include "log.h"
34#include "servconf.h"
35#include "compat.h"

--- 124 unchanged lines hidden (view full) ---

160
161 if (authctxt->attempt++ == 0) {
162 /* setup auth context */
163 authctxt->pw = PRIVSEP(getpwnamallow(user));
164 authctxt->user = xstrdup(user);
165 if (authctxt->pw && strcmp(service, "ssh-connection")==0) {
166 authctxt->valid = 1;
167 debug2("input_userauth_request: setting up authctxt for %s", user);
168#ifdef USE_PAM
169 if (options.use_pam)
170 PRIVSEP(start_pam(authctxt));
171#endif
172 } else {
173 logit("input_userauth_request: invalid user %s", user);
174 authctxt->pw = fakepw();
168 } else {
169 logit("input_userauth_request: invalid user %s", user);
170 authctxt->pw = fakepw();
175#ifdef USE_PAM
176 if (options.use_pam)
177 PRIVSEP(start_pam(authctxt));
178#endif
179#ifdef SSH_AUDIT_EVENTS
180 PRIVSEP(audit_event(SSH_INVALID_USER));
181#endif
182 }
171#ifdef SSH_AUDIT_EVENTS
172 PRIVSEP(audit_event(SSH_INVALID_USER));
173#endif
174 }
175#ifdef USE_PAM
176 if (options.use_pam)
177 PRIVSEP(start_pam(authctxt));
178#endif
183 setproctitle("%s%s", authctxt->valid ? user : "unknown",
184 use_privsep ? " [net]" : "");
185 authctxt->service = xstrdup(service);
186 authctxt->style = style ? xstrdup(style) : NULL;
187 if (use_privsep)
188 mm_inform_authserv(service, style);
189 } else if (strcmp(user, authctxt->user) != 0 ||
190 strcmp(service, authctxt->service) != 0) {

--- 162 unchanged lines hidden ---
179 setproctitle("%s%s", authctxt->valid ? user : "unknown",
180 use_privsep ? " [net]" : "");
181 authctxt->service = xstrdup(service);
182 authctxt->style = style ? xstrdup(style) : NULL;
183 if (use_privsep)
184 mm_inform_authserv(service, style);
185 } else if (strcmp(user, authctxt->user) != 0 ||
186 strcmp(service, authctxt->service) != 0) {

--- 162 unchanged lines hidden ---