1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibCore: Prevent LockFile fd from leaking into child process

Fixes #9059
This commit is contained in:
Peter Elliott 2021-07-29 09:47:43 +10:00 committed by Gunnar Beutner
parent 15cdb702c2
commit 5d6bf83374

View file

@ -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;