]> andersk Git - openssh.git/blobdiff - serverloop.c
- OpenBSD CVS Sync:
[openssh.git] / serverloop.c
index 79dbe7909979d345735306594c1d52e8efd0bb29..fed943ffb5ab2953d391d6b06e1e90dc45ed841d 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.49 2001/02/15 23:19:59 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.50 2001/02/19 09:53:32 markus Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
@@ -70,6 +70,7 @@ static long fdout_bytes = 0;  /* Number of stdout bytes read from program. */
 static int stdin_eof = 0;      /* EOF message received from client. */
 static int fdout_eof = 0;      /* EOF encountered reading from fdout. */
 static int fderr_eof = 0;      /* EOF encountered readung from fderr. */
+static int fdin_is_tty = 0;    /* fdin points to a tty. */
 static int connection_in;      /* Connection to client (input). */
 static int connection_out;     /* Connection to client (output). */
 static u_int buffer_high;/* "Soft" max buffer size. */
@@ -338,7 +339,7 @@ process_output(fd_set * writeset)
                        fdin = -1;
                } else {
                        /* Successful write. */
-                       if (tcgetattr(fdin, &tio) == 0 &&
+                       if (fdin_is_tty && tcgetattr(fdin, &tio) == 0 &&
                            !(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
                                /*
                                 * Simulate echo to reduce the impact of
@@ -435,6 +436,9 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg)
        if (fderr != -1)
                set_nonblock(fderr);
 
+       if (!(datafellows & SSH_BUG_IGNOREMSG) && isatty(fdin))
+               fdin_is_tty = 1;
+
        connection_in = packet_get_connection_in();
        connection_out = packet_get_connection_out();
 
This page took 0.081145 seconds and 4 git commands to generate.