]> andersk Git - openssh.git/blobdiff - serverloop.c
- markus@cvs.openbsd.org 2001/04/04 14:34:58
[openssh.git] / serverloop.c
index 9dcd88b4b9ff88ef073be1435a7a4cd122c8e11a..4ae02fd1007d28ddb238a4e5fe1e37f339e637c7 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.53 2001/03/02 18:54:31 deraadt Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.56 2001/04/04 14:34:58 markus Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
@@ -53,9 +53,13 @@ RCSID("$OpenBSD: serverloop.c,v 1.53 2001/03/02 18:54:31 deraadt Exp $");
 #include "auth-options.h"
 #include "serverloop.h"
 #include "misc.h"
+#include "kex.h"
 
 extern ServerOptions options;
 
+/* XXX */
+extern Kex *xxx_kex;
+
 static Buffer stdin_buffer;    /* Buffer for stdin data. */
 static Buffer stdout_buffer;   /* Buffer for stdout data. */
 static Buffer stderr_buffer;   /* Buffer for stderr data. */
@@ -391,7 +395,7 @@ drain_output(void)
 void
 process_buffered_input_packets(void)
 {
-       dispatch_run(DISPATCH_NONBLOCK, NULL, NULL);
+       dispatch_run(DISPATCH_NONBLOCK, NULL, compat20 ? xxx_kex : NULL);
 }
 
 /*
@@ -420,7 +424,6 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg)
        child_pid = pid;
        child_terminated = 0;
        signal(SIGCHLD, sigchld_handler);
-       signal(SIGPIPE, SIG_IGN);
 
        /* Initialize our global variables. */
        fdin = fdin_arg;
@@ -655,7 +658,6 @@ server_loop2(void)
        debug("Entering interactive session for SSH2.");
 
        mysignal(SIGCHLD, sigchld_handler2);
-       signal(SIGPIPE, SIG_IGN);
        child_terminated = 0;
        connection_in = packet_get_connection_in();
        connection_out = packet_get_connection_out();
@@ -756,11 +758,6 @@ server_request_direct_tcpip(char *ctype)
           originator, originator_port, target, target_port);
 
        /* XXX check permission */
-       if (no_port_forwarding_flag || !options.allow_tcp_forwarding) {
-               xfree(target);
-               xfree(originator);
-               return NULL;
-       }
        sock = channel_connect_to(target, target_port);
        xfree(target);
        xfree(originator);
@@ -858,6 +855,7 @@ server_input_global_request(int type, int plen, void *ctxt)
        want_reply = packet_get_char();
        debug("server_input_global_request: rtype %s want_reply %d", rtype, want_reply);
 
+       /* -R style forwarding */
        if (strcmp(rtype, "tcpip-forward") == 0) {
                struct passwd *pw;
                char *listen_address;
@@ -911,6 +909,9 @@ server_init_dispatch_20(void)
        dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &channel_input_channel_request);
        dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust);
        dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request);
+
+       /* rekeying */
+       dispatch_set(SSH2_MSG_KEXINIT, &kex_input_kexinit);
 }
 void
 server_init_dispatch_13(void)
This page took 0.056262 seconds and 4 git commands to generate.