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

Several file handling hardenings #137

Closed
wants to merge 3 commits into from

Conversation

kbabioch
Copy link
Contributor

@kbabioch kbabioch commented Apr 5, 2018

This hardens the file handling of the module by making use of the O_CLOEXEC flag for file descriptors and making sure that /dev/urandom is a character based device.

This opens any file descriptors with the O_CLOEXEC flag, which will make sure
that file descriptors won't be leaked into any child process. This was
previously an issue due to a forgotten fclose() (Yubico#136).
This uses mkostemp() instead of mkstemp(), passing along the `O_CLOEXEC` flag,
which makes sure that the file descriptor is closed and won't be leaked into
any child process, which was previously an issue due to a missing fclose()
(Yubico#136).
This adds the `e` flag to fopen() calls, making sure the `O_CLOEXEC` flag is
used. This makes sure that the file descriptor is being closed and not leaked
into child processes. This was an issues previously due to a missing fclose()
(Yubico#136).
@kbabioch kbabioch force-pushed the feat/fdcloexec branch 2 times, most recently from 994317e to 2c5d4d4 Compare April 6, 2018 11:08
@kbabioch
Copy link
Contributor Author

kbabioch commented Apr 6, 2018

Will re-submit, since there seem to be some issues (implicit declaration, etc.).

@kbabioch kbabioch closed this Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant