summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Peckham <bpeckham@google.com>2019-03-29 14:41:40 +0100
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-03-29 14:41:40 +0100
commit50bda24f1eb7b2f847b72b7ba3ffaae41eaef7d2 (patch)
tree9cc49431b212048276ff1bc8d8cd7ba401f611a8
parentMerge "Fix bogus error checking on unique_fd" (diff)
parentUse flags = 0 to avoid fd closing for child updater process (diff)
downloadandroid_bootable_recovery-50bda24f1eb7b2f847b72b7ba3ffaae41eaef7d2.tar
android_bootable_recovery-50bda24f1eb7b2f847b72b7ba3ffaae41eaef7d2.tar.gz
android_bootable_recovery-50bda24f1eb7b2f847b72b7ba3ffaae41eaef7d2.tar.bz2
android_bootable_recovery-50bda24f1eb7b2f847b72b7ba3ffaae41eaef7d2.tar.lz
android_bootable_recovery-50bda24f1eb7b2f847b72b7ba3ffaae41eaef7d2.tar.xz
android_bootable_recovery-50bda24f1eb7b2f847b72b7ba3ffaae41eaef7d2.tar.zst
android_bootable_recovery-50bda24f1eb7b2f847b72b7ba3ffaae41eaef7d2.zip
Diffstat (limited to '')
-rw-r--r--install.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/install.cpp b/install.cpp
index b7fb78878..ffa39e46b 100644
--- a/install.cpp
+++ b/install.cpp
@@ -342,7 +342,9 @@ static int try_update_binary(const std::string& package, ZipArchiveHandle zip, b
// The updater in child process writes to the pipe to communicate with recovery.
android::base::unique_fd pipe_read, pipe_write;
- if (!android::base::Pipe(&pipe_read, &pipe_write)) {
+ // Explicitly disable O_CLOEXEC using 0 as the flags (last) parameter to Pipe
+ // so that the child updater process will recieve a non-closed fd.
+ if (!android::base::Pipe(&pipe_read, &pipe_write, 0)) {
PLOG(ERROR) << "Failed to create pipe for updater-recovery communication";
return INSTALL_CORRUPT;
}