1.2pre17: -C option to scp

Henrik Nordstrom henrik.nordstrom at edt.ericsson.se
Tue Dec 28 06:18:57 EST 1999


Simple patch adding the -C option to scp: Disable the use of privilegied
ports (-P option to ssh).

The patch does not include manpage documentation of the command option.

--
Henrik Nordstrom
-------------- next part --------------
--- scp.cscp-L	Tue Dec  7 05:38:32 1999
+++ scp.c	Mon Dec 27 19:29:26 1999
@@ -87,6 +87,10 @@
    and passphrase queries are not allowed). */
 int batchmode = 0;
 
+/* This is set to non-zero if the use of low ports (for rhost-RSA)
+ * should be disabled */
+int nolowports;
+
 /* This is set to the cipher type string if given on the command line. */
 char *cipher = NULL;
 
@@ -167,6 +171,8 @@
 			args[i++] = "-l";
 			args[i++] = remuser;
 		}
+		if (nolowports)
+			args[i++] = "-P";
 		args[i++] = host;
 		args[i++] = cmd;
 		args[i++] = NULL;
@@ -242,7 +248,7 @@
 	extern int optind;
 
 	fflag = tflag = 0;
-	while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q")) != EOF)
+	while ((ch = getopt(argc, argv, "dfprtvLBCc:i:P:q")) != EOF)
 		switch (ch) {
 		/* User-visible flags. */
 		case 'p':
@@ -253,6 +259,9 @@
 			break;
 		case 'r':
 			iamrecursive = 1;
+			break;
+		case 'L':
+			nolowports = 1;
 			break;
 		/* Server options. */
 		case 'd':


More information about the openssh-unix-dev mailing list