summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--scp.c12
2 files changed, 7 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index fb737717b..4aec5c5c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
3 - deraadt@cvs.openbsd.org 2006/04/01 05:42:20 3 - deraadt@cvs.openbsd.org 2006/04/01 05:42:20
4 [scp.c] 4 [scp.c]
5 minimal lint cleanup (unused crud, and some size_t); ok djm 5 minimal lint cleanup (unused crud, and some size_t); ok djm
6 - djm@cvs.openbsd.org 2006/04/01 05:50:29
7 [scp.c]
8 xasprintification; ok deraadt@
6 9
720060421 1020060421
8 - (djm) [Makefile.in configure.ac session.c sshpty.c] 11 - (djm) [Makefile.in configure.ac session.c sshpty.c]
@@ -4514,4 +4517,4 @@
4514 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 4517 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
4515 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 4518 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
4516 4519
4517$Id: ChangeLog,v 1.4303 2006/04/23 02:04:27 djm Exp $ 4520$Id: ChangeLog,v 1.4304 2006/04/23 02:04:46 djm Exp $
diff --git a/scp.c b/scp.c
index 6c8bbcdb7..2778f8f80 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scp.c,v 1.140 2006/04/01 05:42:20 deraadt Exp $ */ 1/* $OpenBSD: scp.c,v 1.141 2006/04/01 05:50:29 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).
@@ -422,7 +422,6 @@ toremote(char *targ, int argc, char **argv)
422{ 422{
423 char *bp, *host, *src, *suser, *thost, *tuser, *arg; 423 char *bp, *host, *src, *suser, *thost, *tuser, *arg;
424 arglist alist; 424 arglist alist;
425 size_t len;
426 int i; 425 int i;
427 426
428 memset(&alist, '\0', sizeof(alist)); 427 memset(&alist, '\0', sizeof(alist));
@@ -488,9 +487,7 @@ toremote(char *targ, int argc, char **argv)
488 errs = 1; 487 errs = 1;
489 } else { /* local to remote */ 488 } else { /* local to remote */
490 if (remin == -1) { 489 if (remin == -1) {
491 len = strlen(targ) + CMDNEEDS + 20; 490 xasprintf(&bp, "%s -t %s", cmd, targ);
492 bp = xmalloc(len);
493 (void) snprintf(bp, len, "%s -t %s", cmd, targ);
494 host = cleanhostname(thost); 491 host = cleanhostname(thost);
495 if (do_cmd(host, tuser, bp, &remin, 492 if (do_cmd(host, tuser, bp, &remin,
496 &remout) < 0) 493 &remout) < 0)
@@ -509,7 +506,6 @@ tolocal(int argc, char **argv)
509{ 506{
510 char *bp, *host, *src, *suser; 507 char *bp, *host, *src, *suser;
511 arglist alist; 508 arglist alist;
512 size_t len;
513 int i; 509 int i;
514 510
515 memset(&alist, '\0', sizeof(alist)); 511 memset(&alist, '\0', sizeof(alist));
@@ -542,9 +538,7 @@ tolocal(int argc, char **argv)
542 suser = pwd->pw_name; 538 suser = pwd->pw_name;
543 } 539 }
544 host = cleanhostname(host); 540 host = cleanhostname(host);
545 len = strlen(src) + CMDNEEDS + 20; 541 xasprintf(&bp, "%s -f %s", cmd, src);
546 bp = xmalloc(len);
547 (void) snprintf(bp, len, "%s -f %s", cmd, src);
548 if (do_cmd(host, suser, bp, &remin, &remout) < 0) { 542 if (do_cmd(host, suser, bp, &remin, &remout) < 0) {
549 (void) xfree(bp); 543 (void) xfree(bp);
550 ++errs; 544 ++errs;