Commit c056a910 authored by Mike Hibler's avatar Mike Hibler
Browse files

Add O_TRUNC to the open call for the image we are uploading.

parent 45fd4ae2
...@@ -70,8 +70,8 @@ main(int argc, char **argv) ...@@ -70,8 +70,8 @@ main(int argc, char **argv)
net_init(); net_init();
FrisLog("%s: listening on port %d for image data from %s (max of %llu bytes)", FrisLog("%s: listening as %d/%d on port %d for image data from %s (max of %llu bytes)",
path, portnum, inet_ntoa(clientip), maxsize); path, geteuid(), getegid(), portnum, inet_ntoa(clientip), maxsize);
if (idletimeout || timeout) if (idletimeout || timeout)
FrisLog("%s: using idletimeout=%ds, timeout=%ds\n", FrisLog("%s: using idletimeout=%ds, timeout=%ds\n",
path, idletimeout, timeout); path, idletimeout, timeout);
...@@ -233,7 +233,7 @@ recv_file() ...@@ -233,7 +233,7 @@ recv_file()
if (strcmp(path, "-") == 0) if (strcmp(path, "-") == 0)
fd = STDOUT_FILENO; fd = STDOUT_FILENO;
else else
fd = open(path, O_WRONLY|O_CREAT, 0644); fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (fd < 0) { if (fd < 0) {
FrisPwarning(path); FrisPwarning(path);
goto done; goto done;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment