summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/serverloop.c b/serverloop.c
index a95390273..21656cf87 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: serverloop.c,v 1.110 2003/06/24 08:23:46 markus Exp $"); 38RCSID("$OpenBSD: serverloop.c,v 1.111 2003/09/23 20:17:11 markus Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "packet.h" 41#include "packet.h"
@@ -60,7 +60,7 @@ extern ServerOptions options;
60 60
61/* XXX */ 61/* XXX */
62extern Kex *xxx_kex; 62extern Kex *xxx_kex;
63static Authctxt *xxx_authctxt; 63extern Authctxt *the_authctxt;
64 64
65static Buffer stdin_buffer; /* Buffer for stdin data. */ 65static Buffer stdin_buffer; /* Buffer for stdin data. */
66static Buffer stdout_buffer; /* Buffer for stdout data. */ 66static Buffer stdout_buffer; /* Buffer for stdout data. */
@@ -355,13 +355,13 @@ process_input(fd_set * readset)
355 connection_closed = 1; 355 connection_closed = 1;
356 if (compat20) 356 if (compat20)
357 return; 357 return;
358 fatal_cleanup(); 358 cleanup_exit(255);
359 } else if (len < 0) { 359 } else if (len < 0) {
360 if (errno != EINTR && errno != EAGAIN) { 360 if (errno != EINTR && errno != EAGAIN) {
361 verbose("Read error from remote host " 361 verbose("Read error from remote host "
362 "%.100s: %.100s", 362 "%.100s: %.100s",
363 get_remote_ipaddr(), strerror(errno)); 363 get_remote_ipaddr(), strerror(errno));
364 fatal_cleanup(); 364 cleanup_exit(255);
365 } 365 }
366 } else { 366 } else {
367 /* Buffer any received data. */ 367 /* Buffer any received data. */
@@ -756,8 +756,6 @@ server_loop2(Authctxt *authctxt)
756 max_fd = MAX(connection_in, connection_out); 756 max_fd = MAX(connection_in, connection_out);
757 max_fd = MAX(max_fd, notify_pipe[0]); 757 max_fd = MAX(max_fd, notify_pipe[0]);
758 758
759 xxx_authctxt = authctxt;
760
761 server_init_dispatch(); 759 server_init_dispatch();
762 760
763 for (;;) { 761 for (;;) {
@@ -900,7 +898,7 @@ server_request_session(char *ctype)
900 c = channel_new(ctype, SSH_CHANNEL_LARVAL, 898 c = channel_new(ctype, SSH_CHANNEL_LARVAL,
901 -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT, 899 -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT,
902 0, "server-session", 1); 900 0, "server-session", 1);
903 if (session_open(xxx_authctxt, c->self) != 1) { 901 if (session_open(the_authctxt, c->self) != 1) {
904 debug("session open failed, free channel %d", c->self); 902 debug("session open failed, free channel %d", c->self);
905 channel_free(c); 903 channel_free(c);
906 return NULL; 904 return NULL;
@@ -974,7 +972,7 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
974 char *listen_address; 972 char *listen_address;
975 u_short listen_port; 973 u_short listen_port;
976 974
977 pw = auth_get_user(); 975 pw = the_authctxt->pw;
978 if (pw == NULL) 976 if (pw == NULL)
979 fatal("server_input_global_request: no user"); 977 fatal("server_input_global_request: no user");
980 listen_address = packet_get_string(NULL); 978 listen_address = packet_get_string(NULL);