diff options
author | HansH111 <hans@atbas.org> | 2022-03-13 14:20:02 +0000 |
---|---|---|
committer | HansH111 <hans@atbas.org> | 2022-03-13 14:20:02 +0000 |
commit | 5d8334da3ddf8e3932766503fe7ef85cb1f8edad (patch) | |
tree | 38a18e1f3bf4062ff2daa65c1bafbc8d8d815c58 | |
parent | 753b825b1afab9645dc6b62bd03d6270c3ffa54b (diff) | |
download | dropbear-5d8334da3ddf8e3932766503fe7ef85cb1f8edad.tar.gz |
use option -q for suppression remote banner output, pass option also for proxy command
-rw-r--r-- | cli-runopts.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli-runopts.c b/cli-runopts.c index fdedf72..cbd15b3 100644 --- a/cli-runopts.c +++ b/cli-runopts.c @@ -62,6 +62,7 @@ static void printhelp() { "-T Don't allocate a pty\n" "-N Don't run a remote command\n" "-f Run in background after auth\n" + "-q quiet, don't show remote banner\n" "-y Always accept remote host key if unknown\n" "-y -y Don't perform any remote host key checking (caution)\n" "-s Request a subsystem (use by external sftp)\n" @@ -141,6 +142,7 @@ void cli_getopts(int argc, char ** argv) { cli_opts.username = NULL; cli_opts.cmd = NULL; cli_opts.no_cmd = 0; + cli_opts.quiet = 0; cli_opts.backgrounded = 0; cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */ cli_opts.always_accept_key = 0; @@ -214,6 +216,9 @@ void cli_getopts(int argc, char ** argv) { } cli_opts.always_accept_key = 1; break; + case 'q': /* quiet */ + cli_opts.quiet = 1; + break; case 'p': /* remoteport */ next = (char**)&cli_opts.remoteport; break; @@ -540,6 +545,12 @@ multihop_passthrough_args() { ret = m_malloc(len); total = 0; + if (cli_opts.quiet) + { + int written = snprintf(ret+total, len-total, "-q "); + total += written; + } + if (cli_opts.no_hostkey_check) { int written = snprintf(ret+total, len-total, "-y -y "); |