1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-22 18:29:36 +01:00

libutil/unix: Add O_CLOEXEC to openDirectory

As a precaution. This function might get used for some long persisted
file descriptor and we need good defaults.
This commit is contained in:
Sergei Zimmerman 2025-11-21 02:43:26 +03:00
parent 5caebab63a
commit ea4854fda1
No known key found for this signature in database

View file

@ -16,7 +16,7 @@ namespace nix {
Descriptor openDirectory(const std::filesystem::path & path)
{
return open(path.c_str(), O_RDONLY | O_DIRECTORY);
return open(path.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC);
}
void setWriteTime(