Mercurial > dropbear
comparison cli-runopts.c @ 541:b151e6df683e
disapproval of revision '6d6160b277bfc7c2db6888a2ac91ac618cef6de3'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 08 Jun 2009 14:51:22 +0000 |
parents | 6c906f903f1d |
children | 9e51707cd6f2 |
comparison
equal
deleted
inserted
replaced
540:6c906f903f1d | 541:b151e6df683e |
---|---|
88 ,DROPBEAR_VERSION, cli_opts.progname, | 88 ,DROPBEAR_VERSION, cli_opts.progname, |
89 DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE, DEFAULT_IDLE_TIMEOUT); | 89 DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE, DEFAULT_IDLE_TIMEOUT); |
90 | 90 |
91 } | 91 } |
92 | 92 |
93 /* Note that options that affect the transport or auth layers (such as -i or | |
94 * -W) should also be passed through to a multi-hop child proxycmd, in | |
95 * parse_multihop_hostname(). */ | |
96 | |
97 void cli_getopts(int argc, char ** argv) { | 93 void cli_getopts(int argc, char ** argv) { |
98 | 94 |
99 unsigned int i, j; | 95 unsigned int i, j; |
100 char ** next = 0; | 96 char ** next = 0; |
101 unsigned int cmdlen; | 97 unsigned int cmdlen; |
471 dropbear_exit("-J can't be used with multihop mode"); | 467 dropbear_exit("-J can't be used with multihop mode"); |
472 } | 468 } |
473 if (cli_opts.remoteport == NULL) { | 469 if (cli_opts.remoteport == NULL) { |
474 cli_opts.remoteport = "22"; | 470 cli_opts.remoteport = "22"; |
475 } | 471 } |
476 cmd_len = strlen(argv0) + strlen(remainder) | 472 cmd_len = strlen(remainder) |
477 + strlen(cli_opts.remotehost) + strlen(cli_opts.remoteport) | 473 + strlen(cli_opts.remotehost) + strlen(cli_opts.remoteport) |
478 + 30; | 474 + strlen(argv0) + 30; |
479 cli_opts.proxycmd = m_malloc(cmd_len); | 475 cli_opts.proxycmd = m_malloc(cmd_len); |
480 snprintf(cli_opts.proxycmd, cmd_len, "%s -B %s:%s %s", | 476 snprintf(cli_opts.proxycmd, cmd_len, "%s -B %s:%s %s", |
481 argv0, cli_opts.remotehost, cli_opts.remoteport, remainder); | 477 argv0, cli_opts.remotehost, cli_opts.remoteport, remainder); |
482 } | 478 } |
483 } | 479 } |