version 1.382, 2022/11/10 23:03:10 |
version 1.383, 2022/11/28 01:37:36 |
|
|
#define SUPPRESS_MUXCLIENT 1 /* don't show in mux client sessions */ |
#define SUPPRESS_MUXCLIENT 1 /* don't show in mux client sessions */ |
#define SUPPRESS_MUXMASTER 2 /* don't show in mux master sessions */ |
#define SUPPRESS_MUXMASTER 2 /* don't show in mux master sessions */ |
#define SUPPRESS_SYSLOG 4 /* don't show when logging to syslog */ |
#define SUPPRESS_SYSLOG 4 /* don't show when logging to syslog */ |
|
#define SUPPRESS_NOCMDLINE 8 /* don't show when cmdline disabled*/ |
struct escape_help_text { |
struct escape_help_text { |
const char *cmd; |
const char *cmd; |
const char *text; |
const char *text; |
|
|
{".", "terminate connection (and any multiplexed sessions)", |
{".", "terminate connection (and any multiplexed sessions)", |
SUPPRESS_MUXCLIENT}, |
SUPPRESS_MUXCLIENT}, |
{"B", "send a BREAK to the remote system", SUPPRESS_NEVER}, |
{"B", "send a BREAK to the remote system", SUPPRESS_NEVER}, |
{"C", "open a command line", SUPPRESS_MUXCLIENT}, |
{"C", "open a command line", SUPPRESS_MUXCLIENT|SUPPRESS_NOCMDLINE}, |
{"R", "request rekey", SUPPRESS_NEVER}, |
{"R", "request rekey", SUPPRESS_NEVER}, |
{"V/v", "decrease/increase verbosity (LogLevel)", SUPPRESS_MUXCLIENT}, |
{"V/v", "decrease/increase verbosity (LogLevel)", SUPPRESS_MUXCLIENT}, |
{"^Z", "suspend ssh", SUPPRESS_MUXCLIENT}, |
{"^Z", "suspend ssh", SUPPRESS_MUXCLIENT}, |
|
|
suppress_flags = |
suppress_flags = |
(mux_client ? SUPPRESS_MUXCLIENT : 0) | |
(mux_client ? SUPPRESS_MUXCLIENT : 0) | |
(mux_client ? 0 : SUPPRESS_MUXMASTER) | |
(mux_client ? 0 : SUPPRESS_MUXMASTER) | |
(using_stderr ? 0 : SUPPRESS_SYSLOG); |
(using_stderr ? 0 : SUPPRESS_SYSLOG) | |
|
(options.enable_escape_commandline == 0 ? SUPPRESS_NOCMDLINE : 0); |
|
|
for (i = 0; i < sizeof(esc_txt)/sizeof(esc_txt[0]); i++) { |
for (i = 0; i < sizeof(esc_txt)/sizeof(esc_txt[0]); i++) { |
if (esc_txt[i].flags & suppress_flags) |
if (esc_txt[i].flags & suppress_flags) |
|
|
case 'C': |
case 'C': |
if (c && c->ctl_chan != -1) |
if (c && c->ctl_chan != -1) |
goto noescape; |
goto noescape; |
|
if (options.enable_escape_commandline == 0) { |
|
if ((r = sshbuf_putf(berr, |
|
"commandline disabled\r\n")) != 0) |
|
fatal_fr(r, "sshbuf_putf"); |
|
continue; |
|
} |
process_cmdline(ssh); |
process_cmdline(ssh); |
continue; |
continue; |
|
|