mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 18:50:27 +09:00
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>
(cherry picked from commit 23f60a56f3)
This commit is contained in:
committed by
Andreas Schneider
parent
8e4491a532
commit
6dc3f666c5
@@ -778,7 +778,10 @@ char *ssh_path_expand_escape(ssh_session session, const char *s) {
|
||||
if (session->opts.port < 65536) {
|
||||
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);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user