From a2c8242a0128b426b70eab941b87508018f08591 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 19 Jun 2024 20:57:48 +1000 Subject: [PATCH] Fix dbclient -m help and -c help w/out hostname. Commit 12ab8ff5 added a check requiring a hostname, but it's before the ciphers and macs are checked. This breaks "dbclient -m help" unless a hostname is also provided. --- src/cli-runopts.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli-runopts.c b/src/cli-runopts.c index 2b35f56b..680fa4d8 100644 --- a/src/cli-runopts.c +++ b/src/cli-runopts.c @@ -399,6 +399,11 @@ void cli_getopts(int argc, char ** argv) { } } +#if DROPBEAR_USER_ALGO_LIST + /* -c help doesn't need a hostname */ + parse_ciphers_macs(); +#endif + if (host_arg == NULL) { /* missing hostname */ printhelp(); dropbear_exit("Remote host needs to provided."); @@ -424,11 +429,6 @@ void cli_getopts(int argc, char ** argv) { cli_opts.username = m_strdup(cli_opts.own_user); } -#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 */