Skip to content

Commit

Permalink
Set a few more close-on-exec flags.
Browse files Browse the repository at this point in the history
git-svn-id: svn://cherokee-project.com/cherokee/trunk@3597 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed Aug 28, 2009
1 parent 60df1da commit a017626
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cherokee/buffer.c
Expand Up @@ -962,6 +962,8 @@ cherokee_buffer_read_file (cherokee_buffer_t *buf, char *filename)
return ret_error;
}

cherokee_fd_set_closexec (f);

/* Read the content
*/
r = read (f, buf->buf + buf->len, info.st_size);
Expand Down
4 changes: 3 additions & 1 deletion cherokee/handler_file.c
Expand Up @@ -290,8 +290,10 @@ open_local_directory (cherokee_handler_file_t *fhdl, cherokee_buffer_t *local_fi
/* Open it
*/
fhdl->fd = open (local_file->buf, O_RDONLY | O_BINARY);
if (fhdl->fd > 0)
if (fhdl->fd > 0) {
cherokee_fd_set_closexec (fhdl->fd);
return ret_ok;
}

/* Manage errors
*/
Expand Down
2 changes: 2 additions & 0 deletions cherokee/validator_htpasswd.c
Expand Up @@ -307,6 +307,8 @@ cherokee_validator_htpasswd_check (cherokee_validator_htpasswd_t *htpasswd,
return ret_error;
}

cherokee_fd_set_closexec (fileno(f));

ret = ret_error;
ret_auth = ret_error;

Expand Down

0 comments on commit a017626

Please sign in to comment.