Skip to content

Commit

Permalink
Docs for -D authorized_keys, check for empty
Browse files Browse the repository at this point in the history
An empty -D doesn't make sense, so reject it.
  • Loading branch information
mkj committed Dec 3, 2024
1 parent 2669abd commit 6652b47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manpages/dropbear.8
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ Disregard the command provided by the user and always run \fIforced_command\fR.
overrides any authorized_keys command= option. The original command is saved in the
SSH_ORIGINAL_COMMAND environment variable (see below).
.TP
.B \-D \fIauthorized_keys_dir
Specify the directory to use for authorized_keys files. The default is ~/.ssh , paths with
a leading ~/ will be home directory expanded.
.TP
.B \-V
Print the version

Expand Down
4 changes: 4 additions & 0 deletions src/svr-runopts.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ void svr_getopts(int argc, char ** argv) {
dropbear_exit("-t and -s are incompatible");
}

if (strlen(svr_opts.authorized_keys_dir) == 0) {
dropbear_exit("Bad -D");
}

#if DROPBEAR_PLUGIN
if (pubkey_plugin) {
svr_opts.pubkey_plugin = m_strdup(pubkey_plugin);
Expand Down

0 comments on commit 6652b47

Please sign in to comment.