Remote file transfer: Fix transfer not working is custom ssh port or identity is specified on the SSH command line

Fixes #4067
This commit is contained in:
Kovid Goyal
2021-09-27 10:58:40 +05:30
parent b70064d1be
commit 3bc7b5bad9
6 changed files with 57 additions and 7 deletions

View File

@@ -118,7 +118,9 @@ class ControlMaster:
'-o', 'TCPKeepAlive=yes', '-o', 'ControlPersist=yes'
]
if conn_data.port:
cmd += ['-p', str(conn_data.port)]
cmd.extend(['-p', str(conn_data.port)])
if conn_data.identity_file:
cmd.extend(['-i', conn_data.identity_file])
self.batch_cmd_prefix = cmd + ['-o', 'BatchMode=yes']
def __enter__(self) -> 'ControlMaster':