Mercurial > dropbear
comparison cli-runopts.c @ 540:6c906f903f1d
Wrap proxycmd function in ENABLE_CLI_PROXYCMD #ifdef
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 08 Jun 2009 14:44:23 +0000 |
parents | a3748e54273c |
children | b151e6df683e |
comparison
equal
deleted
inserted
replaced
539:07a58e4da1ac | 540:6c906f903f1d |
---|---|
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 | |
93 void cli_getopts(int argc, char ** argv) { | 97 void cli_getopts(int argc, char ** argv) { |
94 | 98 |
95 unsigned int i, j; | 99 unsigned int i, j; |
96 char ** next = 0; | 100 char ** next = 0; |
97 unsigned int cmdlen; | 101 unsigned int cmdlen; |
467 dropbear_exit("-J can't be used with multihop mode"); | 471 dropbear_exit("-J can't be used with multihop mode"); |
468 } | 472 } |
469 if (cli_opts.remoteport == NULL) { | 473 if (cli_opts.remoteport == NULL) { |
470 cli_opts.remoteport = "22"; | 474 cli_opts.remoteport = "22"; |
471 } | 475 } |
472 cmd_len = strlen(remainder) | 476 cmd_len = strlen(argv0) + strlen(remainder) |
473 + strlen(cli_opts.remotehost) + strlen(cli_opts.remoteport) | 477 + strlen(cli_opts.remotehost) + strlen(cli_opts.remoteport) |
474 + strlen(argv0) + 30; | 478 + 30; |
475 cli_opts.proxycmd = m_malloc(cmd_len); | 479 cli_opts.proxycmd = m_malloc(cmd_len); |
476 snprintf(cli_opts.proxycmd, cmd_len, "%s -B %s:%s %s", | 480 snprintf(cli_opts.proxycmd, cmd_len, "%s -B %s:%s %s", |
477 argv0, cli_opts.remotehost, cli_opts.remoteport, remainder); | 481 argv0, cli_opts.remotehost, cli_opts.remoteport, remainder); |
478 } | 482 } |
479 } | 483 } |