summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--scp.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c69c135a..cd7032735 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,11 @@
42 [PROTOCOL.mux] 42 [PROTOCOL.mux]
43 MUX_C_CLOSE_FWD includes forward type in message (though it isn't 43 MUX_C_CLOSE_FWD includes forward type in message (though it isn't
44 implemented anyway) 44 implemented anyway)
45 - djm@cvs.openbsd.org 2011/09/09 22:37:01
46 [scp.c]
47 suppress adding '--' to remote commandlines when the first argument
48 does not start with '-'. saves breakage on some difficult-to-upgrade
49 embedded/router platforms; feedback & ok dtucker ok markus
45 50
4620110909 5120110909
47 - (dtucker) [entropy.h] Bug #1932: remove old definition of init_rng. From 52 - (dtucker) [entropy.h] Bug #1932: remove old definition of init_rng. From
diff --git a/scp.c b/scp.c
index 18b2597fe..08587b5f2 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scp.c,v 1.170 2010/12/09 14:13:33 jmc Exp $ */ 1/* $OpenBSD: scp.c,v 1.171 2011/09/09 22:37:01 djm Exp $ */
2/* 2/*
3 * scp - secure remote copy. This is basically patched BSD rcp which 3 * scp - secure remote copy. This is basically patched BSD rcp which
4 * uses ssh to do the data transfer (instead of using rcmd). 4 * uses ssh to do the data transfer (instead of using rcmd).
@@ -601,12 +601,14 @@ toremote(char *targ, int argc, char **argv)
601 host = cleanhostname(argv[i]); 601 host = cleanhostname(argv[i]);
602 suser = NULL; 602 suser = NULL;
603 } 603 }
604 xasprintf(&bp, "%s -f -- %s", cmd, src); 604 xasprintf(&bp, "%s -f %s%s", cmd,
605 *src == '-' ? "-- " : "", src);
605 if (do_cmd(host, suser, bp, &remin, &remout) < 0) 606 if (do_cmd(host, suser, bp, &remin, &remout) < 0)
606 exit(1); 607 exit(1);
607 (void) xfree(bp); 608 (void) xfree(bp);
608 host = cleanhostname(thost); 609 host = cleanhostname(thost);
609 xasprintf(&bp, "%s -t -- %s", cmd, targ); 610 xasprintf(&bp, "%s -t %s%s", cmd,
611 *targ == '-' ? "-- " : "", targ);
610 if (do_cmd2(host, tuser, bp, remin, remout) < 0) 612 if (do_cmd2(host, tuser, bp, remin, remout) < 0)
611 exit(1); 613 exit(1);
612 (void) xfree(bp); 614 (void) xfree(bp);
@@ -652,7 +654,8 @@ toremote(char *targ, int argc, char **argv)
652 errs = 1; 654 errs = 1;
653 } else { /* local to remote */ 655 } else { /* local to remote */
654 if (remin == -1) { 656 if (remin == -1) {
655 xasprintf(&bp, "%s -t -- %s", cmd, targ); 657 xasprintf(&bp, "%s -t %s%s", cmd,
658 *targ == '-' ? "-- " : "", targ);
656 host = cleanhostname(thost); 659 host = cleanhostname(thost);
657 if (do_cmd(host, tuser, bp, &remin, 660 if (do_cmd(host, tuser, bp, &remin,
658 &remout) < 0) 661 &remout) < 0)
@@ -705,7 +708,8 @@ tolocal(int argc, char **argv)
705 suser = pwd->pw_name; 708 suser = pwd->pw_name;
706 } 709 }
707 host = cleanhostname(host); 710 host = cleanhostname(host);
708 xasprintf(&bp, "%s -f -- %s", cmd, src); 711 xasprintf(&bp, "%s -f %s%s",
712 cmd, *src == '-' ? "-- " : "", src);
709 if (do_cmd(host, suser, bp, &remin, &remout) < 0) { 713 if (do_cmd(host, suser, bp, &remin, &remout) < 0) {
710 (void) xfree(bp); 714 (void) xfree(bp);
711 ++errs; 715 ++errs;