summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-09-20 00:57:55 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-09-20 00:57:55 +0000
commit2b7a0e953e3e85c2d95cfb6b4bed095135c3a2b7 (patch)
treea059e0bd658419103c94c154ee12b19ed3da48b2 /scp.c
parent309f3d1d9c6a8f480de33a21f61809c14da97bdd (diff)
- stevesk@cvs.openbsd.org 2001/09/19 19:24:19
[readconf.c readconf.h scp.c sftp.c ssh.1] add ClearAllForwardings ssh option and set it in scp and sftp; ok markus@
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/scp.c b/scp.c
index 512dfa67..e603646b 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.83 2001/09/17 17:57:56 stevesk Exp $");
+RCSID("$OpenBSD: scp.c,v 1.84 2001/09/19 19:24:19 stevesk Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -239,6 +239,7 @@ main(argc, argv)
addargs(&args, "-x");
addargs(&args, "-oForwardAgent no");
addargs(&args, "-oFallBackToRsh no");
+ addargs(&args, "-oClearAllForwardings yes");
fflag = tflag = 0;
while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S:o:F:")) != -1)
@@ -371,13 +372,17 @@ toremote(targ, argc, argv)
for (i = 0; i < argc - 1; i++) {
src = colon(argv[i]);
if (src) { /* remote to remote */
+ static char *ssh_options =
+ "-x -o'FallBackToRsh no' "
+ "-o'ClearAllForwardings yes'";
*src++ = 0;
if (*src == 0)
src = ".";
host = strchr(argv[i], '@');
len = strlen(ssh_program) + strlen(argv[i]) +
strlen(src) + (tuser ? strlen(tuser) : 0) +
- strlen(thost) + strlen(targ) + CMDNEEDS + 32;
+ strlen(thost) + strlen(targ) +
+ strlen(ssh_options) + CMDNEEDS + 20;
bp = xmalloc(len);
if (host) {
*host++ = 0;
@@ -388,19 +393,19 @@ toremote(targ, argc, argv)
else if (!okname(suser))
continue;
snprintf(bp, len,
- "%s%s -x -o'FallBackToRsh no' -n "
+ "%s%s %s -n "
"-l %s %s %s %s '%s%s%s:%s'",
ssh_program, verbose_mode ? " -v" : "",
- suser, host, cmd, src,
+ ssh_options, suser, host, cmd, src,
tuser ? tuser : "", tuser ? "@" : "",
thost, targ);
} else {
host = cleanhostname(argv[i]);
snprintf(bp, len,
- "exec %s%s -x -o'FallBackToRsh no' -n %s "
+ "exec %s%s %s -n %s "
"%s %s '%s%s%s:%s'",
ssh_program, verbose_mode ? " -v" : "",
- host, cmd, src,
+ ssh_options, host, cmd, src,
tuser ? tuser : "", tuser ? "@" : "",
thost, targ);
}