Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable file descriptor sharing with subprocs. #32617

Merged
merged 1 commit into from
Oct 26, 2019

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Oct 7, 2019

On Unix systems, file descriptors are usually shared among child processes.
This means, that if we spawn a subprocess (or we fork) like we do in the editor any open file descriptor will leak to the new process.
This PR sets the close-on-exec flag when opening a file, which causes the file descriptor to not be shared with the child process.

This PR is like #32616 but for files.
I've made this a separate PR and added the label needs testing because it might have a potentially bigger impact if something is wrong with it (although it seems to work in my tests).

On Unix systems, file descriptors are usually shared among child
processes.
This means, that if we spawn a subprocess (or we fork) like we do in
the editor any open file descriptor will leak to the new process.
This PR sets the close-on-exec flag when opening a file, which causes
the file descriptor to not be shared with the child process.
@akien-mga
Copy link
Member

I guess this will best be tested in production :)

@akien-mga akien-mga merged commit ad68596 into godotengine:master Oct 26, 2019
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants