summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-06-05 19:31:41 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-06-05 19:31:41 +0000
commit7bad55b8cbcb0bade494eb30dbd15c67c8cd9f22 (patch)
treea00bd727e14fc207c1d392dda7ee7325ddea7cfe
parent7d68fbf4c53f9e2c9f16b8cd69bc07c377b114de (diff)
- markus@cvs.openbsd.org 2001/05/19 16:05:41
[scp.c] ftruncate() instead of open()+O_TRUNC like rcp.c does allows scp /path/to/file localhost:/path/to/file
-rw-r--r--ChangeLog6
-rw-r--r--scp.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index dc76b405d..7d7799318 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,10 @@
12 [session.c] 12 [session.c]
13 Disable X11 forwarding if xauth binary is not found. Patch from Nalin 13 Disable X11 forwarding if xauth binary is not found. Patch from Nalin
14 Dahyabhai <nalin@redhat.com>; ok markus@ 14 Dahyabhai <nalin@redhat.com>; ok markus@
15 - markus@cvs.openbsd.org 2001/05/19 16:05:41
16 [scp.c]
17 ftruncate() instead of open()+O_TRUNC like rcp.c does
18 allows scp /path/to/file localhost:/path/to/file
15 19
1620010528 2020010528
17 - (tim) [conifgure.in] add setvbuf test needed for sftp-int.c 21 - (tim) [conifgure.in] add setvbuf test needed for sftp-int.c
@@ -5442,4 +5446,4 @@
5442 - Wrote replacements for strlcpy and mkdtemp 5446 - Wrote replacements for strlcpy and mkdtemp
5443 - Released 1.0pre1 5447 - Released 1.0pre1
5444 5448
5445$Id: ChangeLog,v 1.1229 2001/06/05 19:29:20 mouring Exp $ 5449$Id: ChangeLog,v 1.1230 2001/06/05 19:31:41 mouring Exp $
diff --git a/scp.c b/scp.c
index 52fd513c6..89f05ad96 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
75 */ 75 */
76 76
77#include "includes.h" 77#include "includes.h"
78RCSID("$OpenBSD: scp.c,v 1.70 2001/05/08 19:45:24 mouring Exp $"); 78RCSID("$OpenBSD: scp.c,v 1.71 2001/05/19 16:05:41 markus Exp $");
79 79
80#include "xmalloc.h" 80#include "xmalloc.h"
81#include "atomicio.h" 81#include "atomicio.h"
@@ -804,7 +804,7 @@ sink(argc, argv)
804 } 804 }
805 omode = mode; 805 omode = mode;
806 mode |= S_IWRITE; 806 mode |= S_IWRITE;
807 if ((ofd = open(np, O_WRONLY | O_CREAT | O_TRUNC, mode)) < 0) { 807 if ((ofd = open(np, O_WRONLY|O_CREAT, mode)) < 0) {
808bad: run_err("%s: %s", np, strerror(errno)); 808bad: run_err("%s: %s", np, strerror(errno));
809 continue; 809 continue;
810 } 810 }
@@ -859,12 +859,10 @@ bad: run_err("%s: %s", np, strerror(errno));
859 wrerr = YES; 859 wrerr = YES;
860 wrerrno = j >= 0 ? EIO : errno; 860 wrerrno = j >= 0 ? EIO : errno;
861 } 861 }
862#if 0
863 if (ftruncate(ofd, size)) { 862 if (ftruncate(ofd, size)) {
864 run_err("%s: truncate: %s", np, strerror(errno)); 863 run_err("%s: truncate: %s", np, strerror(errno));
865 wrerr = DISPLAYED; 864 wrerr = DISPLAYED;
866 } 865 }
867#endif
868 if (pflag) { 866 if (pflag) {
869 if (exists || omode != mode) 867 if (exists || omode != mode)
870#ifdef HAVE_FCHMOD 868#ifdef HAVE_FCHMOD