From bddd551e1143ba2b7bf0cd453c15b97817bc917d Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Wed, 4 Jul 2001 04:53:53 +0000 Subject: [PATCH] - markus@cvs.openbsd.org 2001/06/27 02:12:54 [serverloop.c serverloop.h session.c session.h] quick hack to make ssh2 work again. --- ChangeLog | 9 ++++++++- serverloop.c | 8 +++++--- serverloop.h | 4 ++-- session.c | 11 ++++++----- session.h | 4 ++-- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb26d0d9d..cc1f240cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,13 @@ - dugsong@cvs.openbsd.org 2001/06/26 17:41:49 [servconf.c] #include + - markus@cvs.openbsd.org 2001/06/26 20:14:11 + [key.c key.h ssh.c sshconnect1.c sshconnect2.c] + add smartcard support to the client, too (now you can use both + the agent and the client). + - markus@cvs.openbsd.org 2001/06/27 02:12:54 + [serverloop.c serverloop.h session.c session.h] + quick hack to make ssh2 work again. 20010629 - (bal) Removed net_aton() since we don't use it any more @@ -5903,4 +5910,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1361 2001/07/04 04:48:36 mouring Exp $ +$Id: ChangeLog,v 1.1362 2001/07/04 04:53:53 mouring Exp $ diff --git a/serverloop.c b/serverloop.c index 2eb8603d1..ecc7763a4 100644 --- a/serverloop.c +++ b/serverloop.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: serverloop.c,v 1.71 2001/06/25 08:25:39 markus Exp $"); +RCSID("$OpenBSD: serverloop.c,v 1.72 2001/06/27 02:12:52 markus Exp $"); #include "xmalloc.h" #include "packet.h" @@ -59,6 +59,7 @@ extern ServerOptions options; /* XXX */ extern Kex *xxx_kex; +static Authctxt *xxx_authctxt; static Buffer stdin_buffer; /* Buffer for stdin data. */ static Buffer stdout_buffer; /* Buffer for stdout data. */ @@ -658,7 +659,7 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg) } void -server_loop2(void) +server_loop2(Authctxt *authctxt) { fd_set *readset = NULL, *writeset = NULL; int rekeying = 0, max_fd, status; @@ -672,6 +673,7 @@ server_loop2(void) connection_out = packet_get_connection_out(); max_fd = MAX(connection_in, connection_out); + xxx_authctxt = authctxt; server_init_dispatch(); @@ -818,7 +820,7 @@ server_request_session(char *ctype) error("server_request_session: channel_new failed"); return NULL; } - if (session_open(c->self) != 1) { + if (session_open(xxx_authctxt, c->self) != 1) { debug("session open failed, free channel %d", c->self); channel_free(c); return NULL; diff --git a/serverloop.h b/serverloop.h index 9ea2b38d4..f419198d1 100644 --- a/serverloop.h +++ b/serverloop.h @@ -1,4 +1,4 @@ -/* $OpenBSD: serverloop.h,v 1.4 2001/06/26 17:27:24 markus Exp $ */ +/* $OpenBSD: serverloop.h,v 1.5 2001/06/27 02:12:53 markus Exp $ */ /* * Author: Tatu Ylonen @@ -22,6 +22,6 @@ #define SERVERLOOP_H void server_loop(pid_t, int, int, int); -void server_loop2(void); +void server_loop2(Authctxt *); #endif diff --git a/session.c b/session.c index 5a6afa7ec..818f3211b 100644 --- a/session.c +++ b/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.96 2001/06/26 16:15:24 dugsong Exp $"); +RCSID("$OpenBSD: session.c,v 1.97 2001/06/27 02:12:53 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -547,9 +547,9 @@ do_exec_pty(Session *s, const char *command) /* Fork the child. */ if ((pid = fork()) == 0) { + /* Child. Reinitialize the log because the pid has changed. */ log_init(__progname, options.log_level, options.log_facility, log_stderr); - /* Close the master side of the pseudo tty. */ close(ptyfd); @@ -1562,7 +1562,7 @@ session_dump(void) } int -session_open(int chanid) +session_open(Authctxt *authctxt, int chanid) { Session *s = session_new(); debug("session_open: channel %d", chanid); @@ -1570,7 +1570,8 @@ session_open(int chanid) error("no more sessions"); return 0; } - s->pw = auth_get_user(); + s->authctxt = authctxt; + s->pw = authctxt->pw; if (s->pw == NULL) fatal("no user for session %d", s->self); debug("session_open: session %d: link with channel %d", s->self, chanid); @@ -2052,5 +2053,5 @@ session_setup_x11fwd(Session *s) static void do_authenticated2(Authctxt *authctxt) { - server_loop2(); + server_loop2(authctxt); } diff --git a/session.h b/session.h index 39ab7d0e6..fd91ac17c 100644 --- a/session.h +++ b/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.9 2001/06/26 17:27:24 markus Exp $ */ +/* $OpenBSD: session.h,v 1.10 2001/06/27 02:12:54 markus Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -28,7 +28,7 @@ void do_authenticated(Authctxt *); -int session_open(int); +int session_open(Authctxt*, int); void session_input_channel_req(int, void *); void session_close_by_pid(pid_t, int); void session_close_by_channel(int, void *);