summaryrefslogtreecommitdiffhomepage
path: root/cli-runopts.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2020-10-15 19:55:15 +0800
committerMatt Johnston <matt@ucc.asn.au>2020-10-15 19:55:15 +0800
commit0e3e8db5bfca0c579be55e7580a46c593c1384be (patch)
tree2b1a718f633fb95c1f2d689a591cf9e8642697f3 /cli-runopts.c
parent78e17f6ee9a944430da3e517ee1fe384fd6b275b (diff)
parent17873e8c922eded2cec86184673a6d110df6403f (diff)
merge from main
--HG-- branch : fuzz
Diffstat (limited to 'cli-runopts.c')
-rw-r--r--cli-runopts.c17
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);
}