diff options
author | Nick Kralevich <nnk@google.com> | 2018-10-18 16:08:39 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2018-10-18 16:09:40 -0700 |
commit | 2991949001794972e2a8c9ee74e6cd755a28f9f9 (patch) | |
tree | 587286d4b635d52119a9aee621ac4410e19f62f8 | |
parent | 30fa1b786418b6a47fb7e605134bc71a2414e412 (diff) | |
download | system_core-2991949001794972e2a8c9ee74e6cd755a28f9f9.tar.gz system_core-2991949001794972e2a8c9ee74e6cd755a28f9f9.tar.bz2 system_core-2991949001794972e2a8c9ee74e6cd755a28f9f9.zip |
Add O_CLOEXEC
Prevent an FD from accidentally leaking across an exec() boundary.
Test: code compiles.
Change-Id: I90ca6e332802700403f401db016cc6c0c72b0ea3
-rw-r--r-- | init/property_service.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/init/property_service.cpp b/init/property_service.cpp index 5c8b92a34..6aed0a393 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -746,7 +746,7 @@ void load_recovery_id_prop() { return; } - int fd = open(rec->blk_device, O_RDONLY); + int fd = open(rec->blk_device, O_RDONLY | O_CLOEXEC); if (fd == -1) { PLOG(ERROR) << "error opening block device " << rec->blk_device; return; |