aboutsummaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/scp.c b/scp.c
index 0779c3c2b7c4..57c242ffc755 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.261 2024/06/26 23:14:14 deraadt Exp $ */
+/* $OpenBSD: scp.c,v 1.263 2025/03/28 06:04:07 dtucker Exp $ */
/*
* scp - secure remote copy. This is basically patched BSD rcp which
* uses ssh to do the data transfer (instead of using rcmd).
@@ -505,6 +505,7 @@ main(int argc, char **argv)
addargs(&args, "-oClearAllForwardings=yes");
addargs(&args, "-oRemoteCommand=none");
addargs(&args, "-oRequestTTY=no");
+ addargs(&args, "-oControlMaster=no");
fflag = Tflag = tflag = 0;
while ((ch = getopt(argc, argv,
@@ -1085,7 +1086,7 @@ toremote(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
}
if (host && throughlocal) { /* extended remote to remote */
if (mode == MODE_SFTP) {
- if (remin == -1) {
+ if (remin == -1 || conn == NULL) {
/* Connect to dest now */
conn = do_sftp_connect(thost, tuser,
tport, sftp_direct,