mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 18:50:27 +09:00
config: Support expansion in the HostName variable
BUG: https://red.libssh.org/issues/127
The original "fix" for 127 was expanding the wrong variable: Host instead
of HostName.
Signed-off-by: Alex Hermann <alex@hexla.nl>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 9ef7e90821)
This commit is contained in:
committed by
Andreas Schneider
parent
f74d5d5df4
commit
24a3f7020c
@@ -247,7 +247,12 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
|
||||
case SOC_HOSTNAME:
|
||||
p = ssh_config_get_str_tok(&s, NULL);
|
||||
if (p && *parsing) {
|
||||
ssh_options_set(session, SSH_OPTIONS_HOST, p);
|
||||
char *z = ssh_path_expand_escape(session, p);
|
||||
if (z == NULL) {
|
||||
z = strdup(p);
|
||||
}
|
||||
ssh_options_set(session, SSH_OPTIONS_HOST, z);
|
||||
free(z);
|
||||
}
|
||||
break;
|
||||
case SOC_PORT:
|
||||
|
||||
Reference in New Issue
Block a user