[PATCH] Add scp -1 and -2 options to OpenSSH-3.0.2p1
mouring
mouring at etoh.eviladmin.org
Mon Jan 28 06:39:38 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"
>
Why are we adding 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;
The above could be cleaned up to be:
case '1':
case '2':
addargs(&args, "-Protocol=%c", ch)
break;
Still doubtful it will be accepted since -o provides such abilities. And
is even stated in the scp documentation as an exmaple of the -o usage.
- Ben
More information about the openssh-unix-dev
mailing list