[serverloop.c serverloop.h session.c session.h]
     quick hack to make ssh2 work again.
This commit is contained in:
Ben Lindstrom 2001-07-04 04:53:53 +00:00
parent c5b680018b
commit bddd551e11
5 changed files with 23 additions and 13 deletions

View File

@ -76,6 +76,13 @@
- dugsong@cvs.openbsd.org 2001/06/26 17:41:49 - dugsong@cvs.openbsd.org 2001/06/26 17:41:49
[servconf.c] [servconf.c]
#include <kafs.h> #include <kafs.h>
- 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 20010629
- (bal) Removed net_aton() since we don't use it any more - (bal) Removed net_aton() since we don't use it any more
@ -5903,4 +5910,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - 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 $

View File

@ -35,7 +35,7 @@
*/ */
#include "includes.h" #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 "xmalloc.h"
#include "packet.h" #include "packet.h"
@ -59,6 +59,7 @@ extern ServerOptions options;
/* XXX */ /* XXX */
extern Kex *xxx_kex; extern Kex *xxx_kex;
static Authctxt *xxx_authctxt;
static Buffer stdin_buffer; /* Buffer for stdin data. */ static Buffer stdin_buffer; /* Buffer for stdin data. */
static Buffer stdout_buffer; /* Buffer for stdout 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 void
server_loop2(void) server_loop2(Authctxt *authctxt)
{ {
fd_set *readset = NULL, *writeset = NULL; fd_set *readset = NULL, *writeset = NULL;
int rekeying = 0, max_fd, status; int rekeying = 0, max_fd, status;
@ -672,6 +673,7 @@ server_loop2(void)
connection_out = packet_get_connection_out(); connection_out = packet_get_connection_out();
max_fd = MAX(connection_in, connection_out); max_fd = MAX(connection_in, connection_out);
xxx_authctxt = authctxt;
server_init_dispatch(); server_init_dispatch();
@ -818,7 +820,7 @@ server_request_session(char *ctype)
error("server_request_session: channel_new failed"); error("server_request_session: channel_new failed");
return NULL; 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); debug("session open failed, free channel %d", c->self);
channel_free(c); channel_free(c);
return NULL; return NULL;

View File

@ -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 <ylo@cs.hut.fi> * Author: Tatu Ylonen <ylo@cs.hut.fi>
@ -22,6 +22,6 @@
#define SERVERLOOP_H #define SERVERLOOP_H
void server_loop(pid_t, int, int, int); void server_loop(pid_t, int, int, int);
void server_loop2(void); void server_loop2(Authctxt *);
#endif #endif

View File

@ -33,7 +33,7 @@
*/ */
#include "includes.h" #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 "ssh.h"
#include "ssh1.h" #include "ssh1.h"
@ -547,9 +547,9 @@ do_exec_pty(Session *s, const char *command)
/* Fork the child. */ /* Fork the child. */
if ((pid = fork()) == 0) { if ((pid = fork()) == 0) {
/* Child. Reinitialize the log because the pid has changed. */ /* Child. Reinitialize the log because the pid has changed. */
log_init(__progname, options.log_level, options.log_facility, log_stderr); log_init(__progname, options.log_level, options.log_facility, log_stderr);
/* Close the master side of the pseudo tty. */ /* Close the master side of the pseudo tty. */
close(ptyfd); close(ptyfd);
@ -1562,7 +1562,7 @@ session_dump(void)
} }
int int
session_open(int chanid) session_open(Authctxt *authctxt, int chanid)
{ {
Session *s = session_new(); Session *s = session_new();
debug("session_open: channel %d", chanid); debug("session_open: channel %d", chanid);
@ -1570,7 +1570,8 @@ session_open(int chanid)
error("no more sessions"); error("no more sessions");
return 0; return 0;
} }
s->pw = auth_get_user(); s->authctxt = authctxt;
s->pw = authctxt->pw;
if (s->pw == NULL) if (s->pw == NULL)
fatal("no user for session %d", s->self); fatal("no user for session %d", s->self);
debug("session_open: session %d: link with channel %d", s->self, chanid); debug("session_open: session %d: link with channel %d", s->self, chanid);
@ -2052,5 +2053,5 @@ session_setup_x11fwd(Session *s)
static void static void
do_authenticated2(Authctxt *authctxt) do_authenticated2(Authctxt *authctxt)
{ {
server_loop2(); server_loop2(authctxt);
} }

View File

@ -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. * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@ -28,7 +28,7 @@
void do_authenticated(Authctxt *); void do_authenticated(Authctxt *);
int session_open(int); int session_open(Authctxt*, int);
void session_input_channel_req(int, void *); void session_input_channel_req(int, void *);
void session_close_by_pid(pid_t, int); void session_close_by_pid(pid_t, int);
void session_close_by_channel(int, void *); void session_close_by_channel(int, void *);