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

grastate.dat not opened with O_CLOEXEC flag #339

Open
rrva opened this issue Sep 3, 2015 · 0 comments · May be fixed by #502
Open

grastate.dat not opened with O_CLOEXEC flag #339

rrva opened this issue Sep 3, 2015 · 0 comments · May be fixed by #502
Assignees
Labels

Comments

@rrva
Copy link

rrva commented Sep 3, 2015

As seen in this mariadb bug report:

https://mariadb.atlassian.net/browse/MDEV-8743

grastate.dat seems not to be opened with the O_CLOEXEC flag (close on exec). This means that child processes of mysqld have access to that file.

I see that O_CLOEXEC is used in other places in the code, might be some benefit to add it for grastate.dat too?

I quickly checked for grastate.dat, it seems to be opened with std::ifstream in gcomm::ViewState::read_file() which does not support that flag directly. Maybe do an open(..., O_CLOEXEC) first and the create an ifstream from the opened fd (if that's possible)?

@ayurchen ayurchen self-assigned this Oct 13, 2015
@ayurchen ayurchen added the bug label Oct 13, 2015
@ayurchen ayurchen added this to the 25.3.13 milestone Oct 13, 2015
@philip-galera philip-galera removed this from the 25.3.13 milestone Nov 16, 2015
@grooverdan grooverdan linked a pull request Mar 1, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants