From c99d60cbc7f14fb7feffb57bf3745dff5e8bce17 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Mon, 9 Dec 2019 06:48:37 -0800 Subject: [PATCH] init: add missing O_CLOEXEC Test: (hopefully) no more denials at boot Change-Id: I7c20a9bbf27210e0ee5f1bbe69db36bb47c38892 --- init/persistent_properties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/persistent_properties.cpp b/init/persistent_properties.cpp index 3b5a41dba..1758cfa25 100644 --- a/init/persistent_properties.cpp +++ b/init/persistent_properties.cpp @@ -198,7 +198,7 @@ Result WritePersistentPropertyFile(const PersistentProperties& persistent_ // Note in this case, that the source and destination directories are the same, so only one // fsync() is required. auto dir = Dirname(persistent_property_filename); - auto dir_fd = unique_fd{open(dir.c_str(), O_DIRECTORY | O_RDONLY)}; + auto dir_fd = unique_fd{open(dir.c_str(), O_DIRECTORY | O_RDONLY | O_CLOEXEC)}; if (dir_fd < 0) { return ErrnoError() << "Unable to open persistent properties directory for fsync()"; }