Skip to content

Commit

Permalink
dbclient: support -o StrictHostKeyChecking
Browse files Browse the repository at this point in the history
dbclient -y is -o StrictHostKeyChecking=accept-new
dbclient -y -y is -o StrictHostKeyChecking=no
  • Loading branch information
stokito committed Dec 19, 2023
1 parent 17657c3 commit b968c08
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cli-runopts.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ static void add_extendedopt(const char* origstr) {
"\tUseSyslog\n"
#endif
"\tPort\n"
"\tStrictHostKeyChecking\n"
);
exit(EXIT_SUCCESS);
}
Expand Down Expand Up @@ -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);
}

0 comments on commit b968c08

Please sign in to comment.