From b968c08c421d5d7c7e79289d5218fc6d8c51cc39 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Wed, 20 Dec 2023 00:07:46 +0200 Subject: [PATCH] dbclient: support -o StrictHostKeyChecking dbclient -y is -o StrictHostKeyChecking=accept-new dbclient -y -y is -o StrictHostKeyChecking=no --- src/cli-runopts.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cli-runopts.c b/src/cli-runopts.c index 38a73f7a6..2f18e2824 100644 --- a/src/cli-runopts.c +++ b/src/cli-runopts.c @@ -897,6 +897,7 @@ static void add_extendedopt(const char* origstr) { "\tUseSyslog\n" #endif "\tPort\n" + "\tStrictHostKeyChecking\n" ); exit(EXIT_SUCCESS); } @@ -925,5 +926,14 @@ static void add_extendedopt(const char* origstr) { return; } + if (match_extendedopt(&optstr, "StrictHostKeyChecking") == DROPBEAR_SUCCESS) { + if (strcmp(optstr, "accept-new") == 0) { + cli_opts.no_hostkey_check = 1; + } else { + cli_opts.always_accept_key = parse_flag_value(optstr); + } + return; + } + dropbear_log(LOG_WARNING, "Ignoring unknown configuration option '%s'", origstr); }