config: Expand tilde when handling include directives

Related: #93

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2022-08-31 16:18:16 +02:00
committed by Andreas Schneider
parent 7787dad9bd
commit d69026d7a4
3 changed files with 56 additions and 1 deletions

View File

@@ -548,6 +548,11 @@ ssh_config_make_absolute(ssh_session session,
return out;
}
/* paths starting with tilde are already absolute */
if (path[0] == '~') {
return ssh_path_expand_tilde(path);
}
/* Parsing user config relative to home directory (generally ~/.ssh) */
if (session->opts.sshdir == NULL) {
ssh_set_error_invalid(session);