zip_archive.cc: add O_CLOEXEC
Prevent file descriptors from leaking across an exec() boundary. Bug: 120983106 Test: compiles and boots Change-Id: I392b0767674b557b1e4404a2ba63bc48e3e37b24
This commit is contained in:
parent
8fd4435d53
commit
3bdf744a55
1 changed files with 1 additions and 1 deletions
|
@ -491,7 +491,7 @@ int32_t OpenArchiveFd(int fd, const char* debug_file_name, ZipArchiveHandle* han
|
|||
}
|
||||
|
||||
int32_t OpenArchive(const char* fileName, ZipArchiveHandle* handle) {
|
||||
const int fd = ::android::base::utf8::open(fileName, O_RDONLY | O_BINARY, 0);
|
||||
const int fd = ::android::base::utf8::open(fileName, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
|
||||
ZipArchive* archive = new ZipArchive(fd, true);
|
||||
*handle = archive;
|
||||
|
||||
|
|
Loading…
Reference in a new issue