]> andersk Git - openssh.git/blobdiff - serverloop.c
- markus@cvs.openbsd.org 2003/05/11 20:30:25
[openssh.git] / serverloop.c
index 1349213554ddb1c9651faa626b3328003330d6a6..39c2a488cc09b046ce656542e5194dd74b0acea0 100644 (file)
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.103 2002/06/24 14:33:27 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.108 2003/05/11 20:30:24 markus Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
 #include "buffer.h"
 #include "log.h"
 #include "servconf.h"
+#include "canohost.h"
 #include "sshpty.h"
 #include "channels.h"
 #include "compat.h"
@@ -143,7 +144,9 @@ sigchld_handler(int sig)
        int save_errno = errno;
        debug("Received SIGCHLD.");
        child_terminated = 1;
+#ifndef _UNICOS
        mysignal(SIGCHLD, sigchld_handler);
+#endif
        notify_parent();
        errno = save_errno;
 }
@@ -347,14 +350,17 @@ process_input(fd_set * readset)
        if (FD_ISSET(connection_in, readset)) {
                len = read(connection_in, buf, sizeof(buf));
                if (len == 0) {
-                       verbose("Connection closed by remote host.");
+                       verbose("Connection closed by %.100s",
+                           get_remote_ipaddr());
                        connection_closed = 1;
                        if (compat20)
                                return;
                        fatal_cleanup();
                } else if (len < 0) {
                        if (errno != EINTR && errno != EAGAIN) {
-                               verbose("Read error from remote host: %.100s", strerror(errno));
+                               verbose("Read error from remote host "
+                                   "%.100s: %.100s",
+                                   get_remote_ipaddr(), strerror(errno));
                                fatal_cleanup();
                        }
                } else {
@@ -765,8 +771,14 @@ server_loop2(Authctxt *authctxt)
                    &nalloc, 0);
 
                collect_children();
-               if (!rekeying)
+               if (!rekeying) {
                        channel_after_select(readset, writeset);
+                       if (packet_need_rekeying()) {
+                               debug("need rekeying");
+                               xxx_kex->done = 0;
+                               kex_send_kexinit(xxx_kex);
+                       }
+               }
                process_input(readset);
                if (connection_closed)
                        break;
@@ -868,7 +880,7 @@ server_request_direct_tcpip(char *ctype)
                return NULL;
        c = channel_new(ctype, SSH_CHANNEL_CONNECTING,
            sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT,
-           CHAN_TCP_PACKET_DEFAULT, 0, xstrdup("direct-tcpip"), 1);
+           CHAN_TCP_PACKET_DEFAULT, 0, "direct-tcpip", 1);
        return c;
 }
 
@@ -887,7 +899,7 @@ server_request_session(char *ctype)
         */
        c = channel_new(ctype, SSH_CHANNEL_LARVAL,
            -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT,
-           0, xstrdup("server-session"), 1);
+           0, "server-session", 1);
        if (session_open(xxx_authctxt, c->self) != 1) {
                debug("session open failed, free channel %d", c->self);
                channel_free(c);
@@ -972,8 +984,11 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
 
                /* check permissions */
                if (!options.allow_tcp_forwarding ||
-                   no_port_forwarding_flag ||
-                   (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)) {
+                   no_port_forwarding_flag
+#ifndef NO_IPPORT_RESERVED_CONCEPT
+                   || (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)
+#endif
+                  ) {
                        success = 0;
                        packet_send_debug("Server has disabled port forwarding.");
                } else {
This page took 0.036046 seconds and 4 git commands to generate.