]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/05/19 16:05:41
authormouring <mouring>
Tue, 5 Jun 2001 19:31:41 +0000 (19:31 +0000)
committermouring <mouring>
Tue, 5 Jun 2001 19:31:41 +0000 (19:31 +0000)
     [scp.c]
     ftruncate() instead of open()+O_TRUNC like rcp.c does
     allows scp /path/to/file localhost:/path/to/file

ChangeLog
scp.c

index 59fda02cf90e7695502235f5aa11ef52ba7beed5..a6793195faa22d4bda31bfc76d825520488655ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      [session.c]
      Disable X11 forwarding if xauth binary is not found. Patch from Nalin
      Dahyabhai <nalin@redhat.com>; ok markus@
+   - 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     
 
 20010528
  - (tim) [conifgure.in] add setvbuf test needed for sftp-int.c
diff --git a/scp.c b/scp.c
index 52fd513c6422c45649d564c482640029f40ab133..89f05ad96ecd9b11b32e821836fa1e88df3f6f39 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.70 2001/05/08 19:45:24 mouring Exp $");
+RCSID("$OpenBSD: scp.c,v 1.71 2001/05/19 16:05:41 markus Exp $");
 
 #include "xmalloc.h"
 #include "atomicio.h"
@@ -804,7 +804,7 @@ sink(argc, argv)
                }
                omode = mode;
                mode |= S_IWRITE;
-               if ((ofd = open(np, O_WRONLY | O_CREAT | O_TRUNC, mode)) < 0) {
+               if ((ofd = open(np, O_WRONLY|O_CREAT, mode)) < 0) {
 bad:                   run_err("%s: %s", np, strerror(errno));
                        continue;
                }
@@ -859,12 +859,10 @@ bad:                      run_err("%s: %s", np, strerror(errno));
                        wrerr = YES;
                        wrerrno = j >= 0 ? EIO : errno;
                }
-#if 0
                if (ftruncate(ofd, size)) {
                        run_err("%s: truncate: %s", np, strerror(errno));
                        wrerr = DISPLAYED;
                }
-#endif
                if (pflag) {
                        if (exists || omode != mode)
 #ifdef HAVE_FCHMOD
This page took 0.062814 seconds and 5 git commands to generate.