summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2003-09-01 02:05:26 +0000
committerColin Watson <cjwatson@debian.org>2003-09-01 02:05:26 +0000
commit6d5a72bc1d98a42ba42f082e50a22e911c1d82d3 (patch)
tree1bf23174bdb6fc71e2846dda0eca195a418484e7 /serverloop.c
parent2ee26b431f98cf1dc0e4fb9809ad1e0c879b8c08 (diff)
parent58657d96514cd6f16d82add8d6f4adbb36765758 (diff)
Debian release 3.5p1-1.
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/serverloop.c b/serverloop.c
index d327ff702..e66d529e9 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -35,13 +35,14 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: serverloop.c,v 1.103 2002/06/24 14:33:27 markus Exp $"); 38RCSID("$OpenBSD: serverloop.c,v 1.104 2002/09/19 16:03:15 stevesk Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "packet.h" 41#include "packet.h"
42#include "buffer.h" 42#include "buffer.h"
43#include "log.h" 43#include "log.h"
44#include "servconf.h" 44#include "servconf.h"
45#include "canohost.h"
45#include "sshpty.h" 46#include "sshpty.h"
46#include "channels.h" 47#include "channels.h"
47#include "compat.h" 48#include "compat.h"
@@ -143,7 +144,9 @@ sigchld_handler(int sig)
143 int save_errno = errno; 144 int save_errno = errno;
144 debug("Received SIGCHLD."); 145 debug("Received SIGCHLD.");
145 child_terminated = 1; 146 child_terminated = 1;
147#ifndef _UNICOS
146 mysignal(SIGCHLD, sigchld_handler); 148 mysignal(SIGCHLD, sigchld_handler);
149#endif
147 notify_parent(); 150 notify_parent();
148 errno = save_errno; 151 errno = save_errno;
149} 152}
@@ -347,14 +350,17 @@ process_input(fd_set * readset)
347 if (FD_ISSET(connection_in, readset)) { 350 if (FD_ISSET(connection_in, readset)) {
348 len = read(connection_in, buf, sizeof(buf)); 351 len = read(connection_in, buf, sizeof(buf));
349 if (len == 0) { 352 if (len == 0) {
350 verbose("Connection closed by remote host."); 353 verbose("Connection closed by %.100s",
354 get_remote_ipaddr());
351 connection_closed = 1; 355 connection_closed = 1;
352 if (compat20) 356 if (compat20)
353 return; 357 return;
354 fatal_cleanup(); 358 fatal_cleanup();
355 } else if (len < 0) { 359 } else if (len < 0) {
356 if (errno != EINTR && errno != EAGAIN) { 360 if (errno != EINTR && errno != EAGAIN) {
357 verbose("Read error from remote host: %.100s", strerror(errno)); 361 verbose("Read error from remote host "
362 "%.100s: %.100s",
363 get_remote_ipaddr(), strerror(errno));
358 fatal_cleanup(); 364 fatal_cleanup();
359 } 365 }
360 } else { 366 } else {
@@ -972,8 +978,11 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
972 978
973 /* check permissions */ 979 /* check permissions */
974 if (!options.allow_tcp_forwarding || 980 if (!options.allow_tcp_forwarding ||
975 no_port_forwarding_flag || 981 no_port_forwarding_flag
976 (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)) { 982#ifndef NO_IPPORT_RESERVED_CONCEPT
983 || (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)
984#endif
985 ) {
977 success = 0; 986 success = 0;
978 packet_send_debug("Server has disabled port forwarding."); 987 packet_send_debug("Server has disabled port forwarding.");
979 } else { 988 } else {