commit | 28af26ac478dcd81145c21b5911e863cb6d0abbd | [log] [tgz] |
---|---|---|
author | Suren Baghdasaryan <surenb@google.com> | Tue Mar 26 10:00:05 2019 -0700 |
committer | Suren Baghdasaryan <surenb@google.com> | Tue Mar 26 20:10:24 2019 +0000 |
tree | 0eec614c875b5f21d3b7abdc061fa25fb4bd4f05 | |
parent | b640f4e337531b79b9dc0df1b5a3357ae0b868f9 [diff] |
Convert ifstream usage into fopen() to prevent fd leaks into child processes std::ifstream does not use O_CLOEXEC flag when opening files. This leads to file descriptors being inherited by child processes. In the case of vold this results in leaking FDs to less privileged children with no permission for these files which occasionally leads to SELinux denials. Bug: 129298168 Change-Id: Id2731782a25d65c9a7cbf25dc441f3e7a17609c1 Signed-off-by: Suren Baghdasaryan <surenb@google.com>