diff options
Diffstat (limited to 'cli-runopts.c')
-rw-r--r-- | cli-runopts.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cli-runopts.c b/cli-runopts.c index abcfc9f..3654b9a 100644 --- a/cli-runopts.c +++ b/cli-runopts.c @@ -214,7 +214,7 @@ void cli_getopts(int argc, char ** argv) { cli_opts.always_accept_key = 1; break; case 'p': /* remoteport */ - next = &cli_opts.remoteport; + next = (char**)&cli_opts.remoteport; break; #if DROPBEAR_CLI_PUBKEY_AUTH case 'i': /* an identityfile */ @@ -378,6 +378,11 @@ void cli_getopts(int argc, char ** argv) { } } +#if DROPBEAR_USER_ALGO_LIST + /* -c help doesn't need a hostname */ + parse_ciphers_macs(); +#endif + /* Done with options/flags; now handle the hostname (which may not * start with a hyphen) and optional command */ @@ -408,10 +413,6 @@ void cli_getopts(int argc, char ** argv) { /* And now a few sanity checks and setup */ -#if DROPBEAR_USER_ALGO_LIST - parse_ciphers_macs(); -#endif - #if DROPBEAR_CLI_PROXYCMD if (cli_opts.proxycmd) { /* To match the common path of m_freeing it */ @@ -891,6 +892,7 @@ static void add_extendedopt(const char* origstr) { #ifndef DISABLE_SYSLOG "\tUseSyslog\n" #endif + "\tPort\n" ); exit(EXIT_SUCCESS); } @@ -909,5 +911,10 @@ static void add_extendedopt(const char* origstr) { } #endif + if (match_extendedopt(&optstr, "Port") == DROPBEAR_SUCCESS) { + cli_opts.remoteport = optstr; + return; + } + dropbear_log(LOG_WARNING, "Ignoring unknown configuration option '%s'", origstr); } |