From 0ea982d4ecf78da46342d1a3f0ee3a14ea6594f3 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 13 Nov 2024 17:40:23 +0100 Subject: [PATCH] channels: Warn against executing multiple commands in single channel Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- doc/command.dox | 6 ++++++ src/channels.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/doc/command.dox b/doc/command.dox index 588151c6..7b5bddb7 100644 --- a/doc/command.dox +++ b/doc/command.dox @@ -91,4 +91,10 @@ that it used: } @endcode +Warning: In a single channel, only ONE command can be executed! +If you want to executed multiple commands, allocate separate channels for +them or consider opening interactive shell. +Attempting to run multiple consecutive commands in one channel will fail. + + */ diff --git a/src/channels.c b/src/channels.c index 72f44102..fdb9e7b2 100644 --- a/src/channels.c +++ b/src/channels.c @@ -2783,6 +2783,12 @@ error: } } @endcode + * + * @warning In a single channel, only ONE command can be executed! + * If you want to executed multiple commands, allocate separate channels for + * them or consider opening interactive shell. + * Attempting to run multiple consecutive commands in one channel will fail. + * See RFC 4254 Section 6.5. * * @see ssh_channel_request_shell() */