mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibCore: Prevent LockFile fd from leaking into child process
Fixes #9059
This commit is contained in:
parent
15cdb702c2
commit
5d6bf83374
Notes:
sideshowbarker
2024-07-18 07:56:32 +09:00
Author: https://github.com/petelliott Commit: https://github.com/SerenityOS/serenity/commit/5d6bf833749 Pull-request: https://github.com/SerenityOS/serenity/pull/9060 Issue: https://github.com/SerenityOS/serenity/issues/9059
@ -19,7 +19,7 @@ LockFile::LockFile(char const* filename, Type type)
|
||||
if (!Core::File::ensure_parent_directories(m_filename))
|
||||
return;
|
||||
|
||||
m_fd = open(filename, O_RDONLY | O_CREAT, 0666);
|
||||
m_fd = open(filename, O_RDONLY | O_CREAT | O_CLOEXEC, 0666);
|
||||
if (m_fd == -1) {
|
||||
m_errno = errno;
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user