summaryrefslogtreecommitdiff
path: root/applypatch/applypatch_modes.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2019-09-23 10:28:54 -0700
committerTao Bao <tbao@google.com>2019-09-23 11:26:48 -0700
commit5234ad466c7006430fcd62f0f0ceeb768da5ec93 (patch)
treeb7ab0af76118d4227d58c098c5db7991ece384b9 /applypatch/applypatch_modes.cpp
parent71c35b9fbaac7f6bbbc175e066564b9509b3bde8 (diff)
applypatch: Add backup_source parameter to PatchPartition.
And set it to false when installing recovery image via applypatch. We only need to back up the source partition when doing in-place update (e.g. when updating a given partition under recovery). When installing recovery image via applypatch, we won't touch the source partition (i.e. /boot). Removing the backup step also allows dropping the dac_override_allowed permission. Previously it was needed due to the access to /cache. Because applypatch runs as root:root, while /cache is owned by system:cache with 0770. Bug: 68319577 Test: Invoke the code that installs recovery image; check that recovery is installed successfully without denials. Test: recovery_unit_test passes on taimen. Change-Id: I549a770b511762189d6672a2835b6e403d695919
Diffstat (limited to 'applypatch/applypatch_modes.cpp')
-rw-r--r--applypatch/applypatch_modes.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/applypatch/applypatch_modes.cpp b/applypatch/applypatch_modes.cpp
index b4665980..bb5eeae9 100644
--- a/applypatch/applypatch_modes.cpp
+++ b/applypatch/applypatch_modes.cpp
@@ -87,7 +87,7 @@ static int PatchMode(const std::string& target_emmc, const std::string& source_e
bonus = std::make_unique<Value>(Value::Type::BLOB, std::move(bonus_contents));
}
- return PatchPartition(target, source, patch, bonus.get()) ? 0 : 1;
+ return PatchPartition(target, source, patch, bonus.get(), false) ? 0 : 1;
}
static void Usage() {