# HG changeset patch # User Matt Johnston # Date 1648785370 -28800 # Node ID e093ddc5b585823c490c4d7416f46a446c97d55f # Parent 62ae35ff833e1c7b885e61e05cc3aa952a828a8f Fix extra default -i arguments for multihop When multihop executes dbclient it should only add -i arguments from the original commandline, not the default id_dropbear key. Otherwise multiple -i arguments keep getting added which results in servers disconnecting with too many auth attempts diff -r 62ae35ff833e -r e093ddc5b585 cli-runopts.c --- a/cli-runopts.c Fri Apr 01 11:21:34 2022 +0800 +++ b/cli-runopts.c Fri Apr 01 11:56:10 2022 +0800 @@ -482,6 +482,17 @@ } #endif + /* The hostname gets set up last, since + * in multi-hop mode it will require knowledge + * of other flags such as -i */ +#if DROPBEAR_CLI_MULTIHOP + parse_multihop_hostname(host_arg, argv[0]); +#else + parse_hostname(host_arg); +#endif + + /* We don't want to include default id_dropbear as a + -i argument for multihop, so handle it later. */ #if (DROPBEAR_CLI_PUBKEY_AUTH) { char *expand_path = expand_homedir_path(DROPBEAR_DEFAULT_CLI_AUTHKEY); @@ -490,14 +501,6 @@ } #endif - /* The hostname gets set up last, since - * in multi-hop mode it will require knowledge - * of other flags such as -i */ -#if DROPBEAR_CLI_MULTIHOP - parse_multihop_hostname(host_arg, argv[0]); -#else - parse_hostname(host_arg); -#endif } #if DROPBEAR_CLI_PUBKEY_AUTH