comparison cli-runopts.c @ 1877:33363a68784d

use option -q for suppression remote banner output, pass option also for proxy command
author HansH111 <hans@atbas.org>
date Sun, 13 Mar 2022 14:20:02 +0000
parents 94dc11094e26
children 3442105b2aba
comparison
equal deleted inserted replaced
1876:bfd0f3248df3 1877:33363a68784d
60 "-l <username>\n" 60 "-l <username>\n"
61 "-t Allocate a pty\n" 61 "-t Allocate a pty\n"
62 "-T Don't allocate a pty\n" 62 "-T Don't allocate a pty\n"
63 "-N Don't run a remote command\n" 63 "-N Don't run a remote command\n"
64 "-f Run in background after auth\n" 64 "-f Run in background after auth\n"
65 "-q quiet, don't show remote banner\n"
65 "-y Always accept remote host key if unknown\n" 66 "-y Always accept remote host key if unknown\n"
66 "-y -y Don't perform any remote host key checking (caution)\n" 67 "-y -y Don't perform any remote host key checking (caution)\n"
67 "-s Request a subsystem (use by external sftp)\n" 68 "-s Request a subsystem (use by external sftp)\n"
68 "-o option Set option in OpenSSH-like format ('-o help' to list options)\n" 69 "-o option Set option in OpenSSH-like format ('-o help' to list options)\n"
69 #if DROPBEAR_CLI_PUBKEY_AUTH 70 #if DROPBEAR_CLI_PUBKEY_AUTH
139 cli_opts.remotehost = NULL; 140 cli_opts.remotehost = NULL;
140 cli_opts.remoteport = NULL; 141 cli_opts.remoteport = NULL;
141 cli_opts.username = NULL; 142 cli_opts.username = NULL;
142 cli_opts.cmd = NULL; 143 cli_opts.cmd = NULL;
143 cli_opts.no_cmd = 0; 144 cli_opts.no_cmd = 0;
145 cli_opts.quiet = 0;
144 cli_opts.backgrounded = 0; 146 cli_opts.backgrounded = 0;
145 cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */ 147 cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */
146 cli_opts.always_accept_key = 0; 148 cli_opts.always_accept_key = 0;
147 cli_opts.no_hostkey_check = 0; 149 cli_opts.no_hostkey_check = 0;
148 cli_opts.is_subsystem = 0; 150 cli_opts.is_subsystem = 0;
211 if (cli_opts.always_accept_key) { 213 if (cli_opts.always_accept_key) {
212 /* twice means no checking at all */ 214 /* twice means no checking at all */
213 cli_opts.no_hostkey_check = 1; 215 cli_opts.no_hostkey_check = 1;
214 } 216 }
215 cli_opts.always_accept_key = 1; 217 cli_opts.always_accept_key = 1;
218 break;
219 case 'q': /* quiet */
220 cli_opts.quiet = 1;
216 break; 221 break;
217 case 'p': /* remoteport */ 222 case 'p': /* remoteport */
218 next = (char**)&cli_opts.remoteport; 223 next = (char**)&cli_opts.remoteport;
219 break; 224 break;
220 #if DROPBEAR_CLI_PUBKEY_AUTH 225 #if DROPBEAR_CLI_PUBKEY_AUTH
537 #endif /* DROPBEAR_CLI_PUBKEY_AUTH */ 542 #endif /* DROPBEAR_CLI_PUBKEY_AUTH */
538 543
539 len += 30; /* space for -W <size>, terminator. */ 544 len += 30; /* space for -W <size>, terminator. */
540 ret = m_malloc(len); 545 ret = m_malloc(len);
541 total = 0; 546 total = 0;
547
548 if (cli_opts.quiet)
549 {
550 int written = snprintf(ret+total, len-total, "-q ");
551 total += written;
552 }
542 553
543 if (cli_opts.no_hostkey_check) 554 if (cli_opts.no_hostkey_check)
544 { 555 {
545 int written = snprintf(ret+total, len-total, "-y -y "); 556 int written = snprintf(ret+total, len-total, "-y -y ");
546 total += written; 557 total += written;