Refuse to overwrite target host-OS file by "get" command.
authorshort <>
Sat, 5 Jul 2003 08:35:19 +0000 (08:35 +0000)
committershort <>
Sat, 5 Jul 2003 08:35:19 +0000 (08:35 +0000)
src/client/cmdline/cmd_get.c

index 9f30320..f73d61e 100644 (file)
@@ -76,7 +76,7 @@ char *s;
                }
 
        if (-1==(fdtgt=open(targetfile,
-                       O_CREAT|O_WRONLY        /* flags */
+                       O_CREAT|O_EXCL|O_WRONLY /* flags */
 #ifdef O_BINARY
                                        | O_BINARY
 #endif /* O_BINARY */