From 5234ad466c7006430fcd62f0f0ceeb768da5ec93 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 23 Sep 2019 10:28:54 -0700 Subject: 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 --- updater/install.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'updater/install.cpp') diff --git a/updater/install.cpp b/updater/install.cpp index be0ceb06c..b617f62c1 100644 --- a/updater/install.cpp +++ b/updater/install.cpp @@ -271,7 +271,7 @@ Value* PatchPartitionFn(const char* name, State* state, return StringValue(""); } - bool result = PatchPartition(target, source, *values[0], nullptr); + bool result = PatchPartition(target, source, *values[0], nullptr, true); return StringValue(result ? "t" : ""); } -- cgit v1.2.3