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

unqlite:enable O_CLOEXEC explicit #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crafcat7
Copy link

@crafcat7 crafcat7 commented Mar 1, 2024

Summary

Added O_CLOEXEC flag when opening files to ensure that file descriptors are automatically closed when executing child processes, thus preventing potential file descriptor leaks.

Changes Made:

Modified the open function to include the O_CLOEXEC flag when opening files.

Potential Scenarios:

Executing child processes: When a parent process opens a file and then spawns a child process, there is a possibility that the child process inherits the open file descriptors. Without the O_CLOEXEC flag, these file descriptors may remain open in the child process, leading to resource leaks and potential security vulnerabilities.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
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.

None yet

1 participant