summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-08-09 23:56:36 +0000
committerDamien Miller <djm@mindrot.org>2021-08-10 12:47:46 +1000
commitbfdd4b722f124a4fa9173d20dd64dd0fc69856be (patch)
tree79fd3b097ac14bbcb004c4fab196e5d890d03e8e /scp.c
parent2f7a3b51cef689ad9e93d0c6c17db5a194eb5555 (diff)
downloadopenssh-git-bfdd4b722f124a4fa9173d20dd64dd0fc69856be.tar.gz
upstream: make scp -3 the default for remote-to-remote copies. It
provides a much better and more intuitive user experience and doesn't require exposing credentials to the source host. thanks naddy@ for catching the missing argument in usage() "Yes please!" - markus@ "makes a lot of sense" - deraadt@ "the right thing to do" - dtucker@ OpenBSD-Commit-ID: d0d2af5f0965c5192ba5b2fa461c9f9b130e5dd9
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/scp.c b/scp.c
index cb8d049b..3eda5483 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.228 2021/08/09 23:49:31 djm Exp $ */
+/* $OpenBSD: scp.c,v 1.229 2021/08/09 23:56:36 djm Exp $ */
/*
* scp - secure remote copy. This is basically patched BSD rcp which
* uses ssh to do the data transfer (instead of using rcmd).
@@ -165,7 +165,7 @@ int showprogress = 1;
* This is set to non-zero if remote-remote copy should be piped
* through this process.
*/
-int throughlocal = 0;
+int throughlocal = 1;
/* Non-standard port to use for the ssh connection or -1. */
int sshport = -1;
@@ -482,7 +482,7 @@ main(int argc, char **argv)
fflag = Tflag = tflag = 0;
while ((ch = getopt(argc, argv,
- "12346ABCTdfpqrtvD:F:J:M:P:S:c:i:l:o:")) != -1) {
+ "12346ABCTdfpqRrtvD:F:J:M:P:S:c:i:l:o:")) != -1) {
switch (ch) {
/* User-visible flags. */
case '1':
@@ -504,6 +504,9 @@ main(int argc, char **argv)
case '3':
throughlocal = 1;
break;
+ case 'R':
+ throughlocal = 0;
+ break;
case 'o':
case 'c':
case 'i':
@@ -1984,7 +1987,7 @@ void
usage(void)
{
(void) fprintf(stderr,
- "usage: scp [-346ABCpqrTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]\n"
+ "usage: scp [-346ABCpqRrTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]\n"
" [-i identity_file] [-J destination] [-l limit] [-M scp|sftp]\n"
" [-o ssh_option] [-P port] [-S program] source ... target\n");
exit(1);