[openssh-commits] [openssh] 01/10: upstream: prepare for scp -3 implemented via sftp

git+noreply at mindrot.org git+noreply at mindrot.org
Sat Aug 7 10:27:15 AEST 2021


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit e3c0ba05873cf3d3f7d19d595667a251026b2d84
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Sat Aug 7 00:00:33 2021 +0000

    upstream: prepare for scp -3 implemented via sftp
    
    OpenBSD-Commit-ID: 194aac0dd87cb175334b71c2a30623a5ad55bb44
---
 scp.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/scp.c b/scp.c
index 9cfcfd84..3125d336 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.217 2021/08/04 01:34:55 dtucker Exp $ */
+/* $OpenBSD: scp.c,v 1.218 2021/08/07 00:00:33 djm Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -453,6 +453,8 @@ main(int argc, char **argv)
 
 	__progname = ssh_get_progname(argv[0]);
 
+	log_init(argv0, log_level, SYSLOG_FACILITY_USER, 1);
+
 	memset(&args, '\0', sizeof(args));
 	memset(&remote_remote_args, '\0', sizeof(remote_remote_args));
 	args.list = remote_remote_args.list = NULL;
@@ -576,11 +578,8 @@ main(int argc, char **argv)
 	/* Do this last because we want the user to be able to override it */
 	addargs(&args, "-oForwardAgent=no");
 
-	if (mode != MODE_SFTP && sftp_direct != NULL)
-		fatal("SFTP direct can be used only in SFTP mode");
-
-	if (mode == MODE_SFTP && iamremote)
-		fatal("The server can not be ran in SFTP mode");
+	if (iamremote)
+		mode = MODE_SCP;
 
 	if ((pwd = getpwuid(userid = getuid())) == NULL)
 		fatal("unknown user %u", (u_int) userid);
@@ -1012,11 +1011,7 @@ toremote(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
 			continue;
 		}
 		if (host && throughlocal) {	/* extended remote to remote */
-			if (mode == MODE_SFTP) {
-				/* TODO */
-				fatal("Extended remote to remote through local "
-				    "is not yet supported with SFTP");
-			}
+			/* XXX uses scp; need to support SFTP remote-remote */
 			xasprintf(&bp, "%s -f %s%s", cmd,
 			    *src == '-' ? "-- " : "", src);
 			if (do_cmd(ssh_program, host, suser, sport, bp,
@@ -1068,14 +1063,6 @@ toremote(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
 			addargs(&alist, "--");
 			addargs(&alist, "%s", host);
 			addargs(&alist, "%s", cmd);
-			/*
-			 * This will work only if the first remote scp
-			 * supports sftp mode
-			 */
-			if (mode == MODE_SFTP) {
-				addargs(&alist, "-M");
-				addargs(&alist, "sftp");
-			}
 			addargs(&alist, "%s", src);
 			addargs(&alist, "%s%s%s:%s",
 			    tuser ? tuser : "", tuser ? "@" : "",

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list