Browse Source

[core] check fcntl O_APPEND succeeds w/ mkstemp()

personal/stbuehler/mod-csrf
Glenn Strauss 5 years ago
parent
commit
06cc3dfa59
  1. 6
      src/chunk.c

6
src/chunk.c

@ -481,8 +481,12 @@ static chunk *chunkqueue_get_append_tempfile(chunkqueue *cq) {
return NULL;
}
if (0 != fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_APPEND)) {
close(fd);
buffer_free(template);
return NULL;
}
fd_close_on_exec(fd);
(void)fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_APPEND);
c = chunkqueue_get_unused_chunk(cq);
c->type = FILE_CHUNK;

Loading…
Cancel
Save