summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-02-19 09:53:33 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-02-19 09:53:33 +0000
commit2509858cad7a9b177a5cdf27ba7e89f5a03a28c1 (patch)
tree8b8f87780fae43e663231bee1d9bbdac2f7cfc48 /usr.bin
parent147724caa4166bbf864e69d7c6009148b51da7db (diff)
ssh-1.2.{18-22} has broken handling of ignore messages; report from itojun@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/compat.c4
-rw-r--r--usr.bin/ssh/compat.h19
-rw-r--r--usr.bin/ssh/serverloop.c8
3 files changed, 19 insertions, 12 deletions
diff --git a/usr.bin/ssh/compat.c b/usr.bin/ssh/compat.c
index 87caf71cec6..bada175a83d 100644
--- a/usr.bin/ssh/compat.c
+++ b/usr.bin/ssh/compat.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: compat.c,v 1.34 2001/01/21 19:05:48 markus Exp $");
+RCSID("$OpenBSD: compat.c,v 1.35 2001/02/19 09:53:31 markus Exp $");
#include <regex.h>
@@ -78,6 +78,8 @@ compat_datafellows(const char *version)
{ "^2\\.4$", SSH_OLD_SESSIONID}, /* Van Dyke */
{ "^3\\.0 SecureCRT", SSH_OLD_SESSIONID},
{ "^1\\.7 SecureFX", SSH_OLD_SESSIONID},
+ { "^1\\.2\\.1[89]", SSH_BUG_IGNOREMSG},
+ { "^1\\.2\\.2[012]", SSH_BUG_IGNOREMSG},
{ NULL, 0 }
};
/* process table, return first match */
diff --git a/usr.bin/ssh/compat.h b/usr.bin/ssh/compat.h
index fb65cd6d631..2726fafff72 100644
--- a/usr.bin/ssh/compat.h
+++ b/usr.bin/ssh/compat.h
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* RCSID("$OpenBSD: compat.h,v 1.14 2001/01/08 22:29:05 markus Exp $"); */
+/* RCSID("$OpenBSD: compat.h,v 1.15 2001/02/19 09:53:31 markus Exp $"); */
#ifndef COMPAT_H
#define COMPAT_H
@@ -31,14 +31,15 @@
#define SSH_PROTO_1_PREFERRED 0x02
#define SSH_PROTO_2 0x04
-#define SSH_BUG_SIGBLOB 0x01
-#define SSH_BUG_PKSERVICE 0x02
-#define SSH_BUG_HMAC 0x04
-#define SSH_BUG_X11FWD 0x08
-#define SSH_OLD_SESSIONID 0x10
-#define SSH_BUG_PKAUTH 0x20
-#define SSH_BUG_DEBUG 0x40
-#define SSH_BUG_BANNER 0x80
+#define SSH_BUG_SIGBLOB 0x0001
+#define SSH_BUG_PKSERVICE 0x0002
+#define SSH_BUG_HMAC 0x0004
+#define SSH_BUG_X11FWD 0x0008
+#define SSH_OLD_SESSIONID 0x0010
+#define SSH_BUG_PKAUTH 0x0020
+#define SSH_BUG_DEBUG 0x0040
+#define SSH_BUG_BANNER 0x0080
+#define SSH_BUG_IGNOREMSG 0x0100
void enable_compat13(void);
void enable_compat20(void);
diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c
index 858cc282b62..4ceee02d1ad 100644
--- a/usr.bin/ssh/serverloop.c
+++ b/usr.bin/ssh/serverloop.c
@@ -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
@@ -434,6 +435,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();