summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2008-05-08 13:06:10 +0000
committerdjm <djm@openbsd.org>2008-05-08 13:06:10 +0000
commit52df02726b7d53167d6897aa463b6e743f9bebbe (patch)
tree940ee55ecc5cbd72f99082b1447e66a24f9d4301 /usr.bin/ssh/ssh.c
parentMake the maximum number of sessions run-time controllable via (diff)
downloadwireguard-openbsd-52df02726b7d53167d6897aa463b6e743f9bebbe.tar.xz
wireguard-openbsd-52df02726b7d53167d6897aa463b6e743f9bebbe.zip
Use new channel status confirmation callback system to properly deal
with "important" channel requests that fail, in particular command exec, shell and subsystem requests. Previously we would optimistically assume that the requests would always succeed, which could cause hangs if they did not (e.g. when the server runs out of fds) or were unimplemented by the server (bz #1384) Also, properly report failing multiplex channel requests via the mux client stderr (subject to LogLevel in the mux master) - better than silently failing. most bits ok markus@ (as part of a larger diff)
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 7e110641b61..d6cd504f1af 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.310 2008/05/08 12:02:23 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.311 2008/05/08 13:06:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1019,21 +1019,6 @@ ssh_session(void)
options.escape_char : SSH_ESCAPECHAR_NONE, 0);
}
-static void
-ssh_subsystem_reply(int type, u_int32_t seq, void *ctxt)
-{
- int id, len;
-
- id = packet_get_int();
- len = buffer_len(&command);
- if (len > 900)
- len = 900;
- packet_check_eom();
- if (type == SSH2_MSG_CHANNEL_FAILURE)
- fatal("Request for subsystem '%.*s' failed on channel %d",
- len, (u_char *)buffer_ptr(&command), id);
-}
-
void
client_global_request_reply_fwd(int type, u_int32_t seq, void *ctxt)
{
@@ -1129,7 +1114,7 @@ ssh_session2_setup(int id, void *arg)
}
client_session2_setup(id, tty_flag, subsystem_flag, getenv("TERM"),
- NULL, fileno(stdin), &command, environ, &ssh_subsystem_reply);
+ NULL, fileno(stdin), &command, environ);
packet_set_interactive(interactive);
}