]> andersk Git - openssh.git/blobdiff - scp.c
- (dtucker) [INSTALL] Link to tcpwrappers.
[openssh.git] / scp.c
diff --git a/scp.c b/scp.c
index 92a67b7339342faff35aa38ac5572b838964d270..1765a44e642f97840998f05289f377f2cb9492e9 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.158 2007/06/12 13:54:28 dtucker Exp $ */
+/* $OpenBSD: scp.c,v 1.160 2007/08/06 19:16:06 sobrado Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -1024,7 +1024,8 @@ bad:                      run_err("%s: %s", np, strerror(errno));
                        wrerr = YES;
                        wrerrno = errno;
                }
-               if (wrerr == NO && ftruncate(ofd, size) != 0) {
+               if (wrerr == NO && (!exists || S_ISREG(stb.st_mode)) &&
+                   ftruncate(ofd, size) != 0) {
                        run_err("%s: truncate: %s", np, strerror(errno));
                        wrerr = DISPLAYED;
                }
@@ -1119,7 +1120,7 @@ usage(void)
        (void) fprintf(stderr,
            "usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]\n"
            "           [-l limit] [-o ssh_option] [-P port] [-S program]\n"
-           "           [[user@]host1:]file1 [...] [[user@]host2:]file2\n");
+           "           [[user@]host1:]file1 ... [[user@]host2:]file2\n");
        exit(1);
 }
 
This page took 0.038864 seconds and 4 git commands to generate.