[PATCH] Add scp -1 and -2 options to OpenSSH-3.0.2p1

John Bowman bowman at math.ualberta.ca
Mon Jan 28 06:48:09 EST 2002


Here is a patch to add the missing scp -1 and -2 options to eliminate
confusion for users familiar with the commercial version of SSH.

This patch and others are maintained on the secure nfs (SNFS) web page:
http://www.math.ualberta.ca/imaging/snfs/

-- John Bowman
University of Alberta

diff -ur openssh-3.0.2p1/scp.c openssh-3.0.2p1J2/scp.c
--- openssh-3.0.2p1/scp.c	Sun Oct 21 18:53:59 2001
+++ openssh-3.0.2p1J2/scp.c	Sat Jan 19 15:26:34 2002
@@ -82,6 +82,7 @@
 #include "pathnames.h"
 #include "log.h"
 #include "misc.h"
+#include "compat.h"
 
 #ifdef HAVE___PROGNAME
 extern char *__progname;
@@ -242,9 +243,15 @@
 	addargs(&args, "-oClearAllForwardings yes");
 
 	fflag = tflag = 0;
-	while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S:o:F:")) != -1)
+	while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q1246S:o:F:")) != -1)
 		switch (ch) {
 		/* User-visible flags. */
+		case '1':
+			addargs(&args, "-oProtocol=1");
+			break;
+		case '2':
+			addargs(&args, "-oProtocol=2");
+			break;
 		case '4':
 		case '6':
 		case 'C':
@@ -966,7 +973,7 @@
 usage()
 {
 	(void) fprintf(stderr,
-	    "usage: scp [-pqrvBC46] [-F config] [-S ssh] [-P port] [-c cipher] [-i identity]\n"
+	    "usage: scp [-pqrvBC1246] [-F config] [-S ssh] [-P port] [-c cipher] [-i identity]\n"
 	    "           [-o option] f1 f2\n"
 	    "   or: scp [options] f1 ... fn directory\n");
 	exit(1);



More information about the openssh-unix-dev mailing list