]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: run the 2nd ssh with BatchMode for scp -3
authormarkus@openbsd.org <markus@openbsd.org>
Thu, 30 Apr 2020 17:07:10 +0000 (17:07 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 1 May 2020 03:13:29 +0000 (13:13 +1000)
OpenBSD-Commit-ID: 77994fc8c7ca02d88e6d0d06d0f0fe842a935748

scp.1
scp.c

diff --git a/scp.1 b/scp.1
index 9c3a85366490883e73096cae00c22370d9fe5faf..36d9e735e7943f0a16ed28552808c2d633c178eb 100644 (file)
--- a/scp.1
+++ b/scp.1
@@ -8,9 +8,9 @@
 .\"
 .\" Created: Sun May  7 00:14:37 1995 ylo
 .\"
-.\" $OpenBSD: scp.1,v 1.87 2019/11/30 07:07:59 jmc Exp $
+.\" $OpenBSD: scp.1,v 1.88 2020/04/30 17:07:10 markus Exp $
 .\"
-.Dd $Mdocdate: November 30 2019 $
+.Dd $Mdocdate: April 30 2020 $
 .Dt SCP 1
 .Os
 .Sh NAME
@@ -74,7 +74,10 @@ The options are as follows:
 Copies between two remote hosts are transferred through the local host.
 Without this option the data is copied directly between the two remote
 hosts.
-Note that this option disables the progress meter.
+Note that this option disables the progress meter and selects batch mode
+for the second host, since
+.Nm scp
+cannot ask passwords or passphrases for both hosts.
 .It Fl 4
 Forces
 .Nm
diff --git a/scp.c b/scp.c
index 6901e0c941cc03f0a576c96412db282f4e7da600..812ab530161eb071f9ceb42266b90916c4287980 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.207 2020/01/23 07:10:22 dtucker Exp $ */
+/* $OpenBSD: scp.c,v 1.208 2020/04/30 17:07:10 markus Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -348,6 +348,7 @@ do_cmd2(char *host, char *remuser, int port, char *cmd, int fdin, int fdout)
                        addargs(&args, "-l");
                        addargs(&args, "%s", remuser);
                }
+               addargs(&args, "-oBatchMode=yes");
                addargs(&args, "--");
                addargs(&args, "%s", host);
                addargs(&args, "%s", cmd);