mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibCore: Prevent LockFile fd from leaking into child process
Fixes #9059
This commit is contained in:
committed by
Gunnar Beutner
parent
15cdb702c2
commit
5d6bf83374
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user