From 52df02726b7d53167d6897aa463b6e743f9bebbe Mon Sep 17 00:00:00 2001 From: djm Date: Thu, 8 May 2008 13:06:10 +0000 Subject: 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) --- usr.bin/ssh/ssh.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'usr.bin/ssh/ssh.c') 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 * Copyright (c) 1995 Tatu Ylonen , 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); } -- cgit v1.2.3-59-g8ed1b