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

Create a pipe and open files with the close-on-exec flag #2071

Merged

Conversation

jrohel
Copy link
Contributor

@jrohel jrohel commented Feb 17, 2025

An application that uses libdnf can create a child process (fork) in another thread and execute the program in it. This will leak open descriptors to the newly executed program.

The close-on-exec flag (O_CLOEXEC) ensures that the descriptors are not passed to the newly running program (they are closed in the child process).

@m-blaha m-blaha self-assigned this Feb 18, 2025
@jrohel jrohel force-pushed the open_descriptors_close_on_exec branch from 400ccc1 to 633f1b6 Compare February 18, 2025 11:47
@m-blaha
Copy link
Member

m-blaha commented Feb 19, 2025

/packit test

An application that uses libdnf can create a child process (`fork`)
in another thread and execute the program in it.  This will leak open
descriptors to the newly executed program.

The close-on-exec flag (`O_CLOEXEC`) ensures that the descriptors are
closed and not passed to the newly running program (they are closed).
@jrohel jrohel force-pushed the open_descriptors_close_on_exec branch from 633f1b6 to 658d5ab Compare February 20, 2025 06:39
Copy link
Member

@m-blaha m-blaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@m-blaha m-blaha added this pull request to the merge queue Feb 20, 2025
Merged via the queue into rpm-software-management:main with commit 07db01d Feb 20, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants