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

John Bowman bowman at math.ualberta.ca
Mon Jan 28 15:52:39 EST 2002


> The above could be cleaned up to be:

Agreed. All that we need is the following. With so few changes required to
fix such a trivial oversight in scp, there can no rational argument against
implementing a fix. You will note that this issue keeps reappearing on this
list; it isn't going to go away on its own. :-)

-- John Bowman
University of Alberta

diff -ur openssh-3.0.2p1/scp.c openssh-3.0.2p1C/scp.c
--- openssh-3.0.2p1/scp.c	Sun Oct 21 18:53:59 2001
+++ openssh-3.0.2p1C/scp.c	Sun Jan 27 18:12:23 2002
@@ -242,9 +242,13 @@
 	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':
+		case '2':
+			addargs(&args, "-oProtocol=%c",ch);
+			break;
 		case '4':
 		case '6':
 		case 'C':
@@ -966,7 +970,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