misc: Set default port to 22 in ssh_path_expand_escape()
Fixes, among others, ProxyCommand with %p when no port is used on commandline or config file, thus using the default port. Fixes T94 Signed-off-by: Alex Hermann <alex@hexla.nl> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
648f5cf400
Коммит
23f60a56f3
@ -778,7 +778,10 @@ char *ssh_path_expand_escape(ssh_session session, const char *s) {
|
|||||||
if (session->opts.port < 65536) {
|
if (session->opts.port < 65536) {
|
||||||
char tmp[6];
|
char tmp[6];
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "%u", session->opts.port);
|
snprintf(tmp,
|
||||||
|
sizeof(tmp),
|
||||||
|
"%u",
|
||||||
|
session->opts.port > 0 ? session->opts.port : 22);
|
||||||
x = strdup(tmp);
|
x = strdup(tmp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user