From 66176c55e9f4926678df26a71e6afe8a1c20540e Mon Sep 17 00:00:00 2001 From: Annie Meng Date: Wed, 16 Jan 2019 21:32:27 +0000 Subject: [PATCH] Create subdirs in system_ce/ for multi-user backup Backup system service bookkeeping is being moved to per-user CE directories to support multiple users participating in the service. Accompanies SELinux changes at aosp/873133 Bug: 121197420 Test: 1) Boot device; check dirs created with correct label; run backup successfully on system user 2) Create secondary user; check dirs created with correct label; run backup successfully Change-Id: I3a0fdbfcf18a3c242fc64fba0dd014160b50b2f0 --- vold_prepare_subdirs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vold_prepare_subdirs.cpp b/vold_prepare_subdirs.cpp index e7264ab..a7c5e3d 100644 --- a/vold_prepare_subdirs.cpp +++ b/vold_prepare_subdirs.cpp @@ -140,6 +140,15 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla if (!prepare_dir(sehandle, 0700, 0, 0, misc_ce_path + "/vold")) return false; if (!prepare_dir(sehandle, 0700, 0, 0, misc_ce_path + "/storaged")) return false; if (!prepare_dir(sehandle, 0700, 0, 0, misc_ce_path + "/rollback")) return false; + + auto system_ce_path = android::vold::BuildDataSystemCePath(user_id); + if (!prepare_dir(sehandle, 0700, AID_SYSTEM, AID_SYSTEM, system_ce_path + "/backup")) { + return false; + } + if (!prepare_dir(sehandle, 0700, AID_SYSTEM, AID_SYSTEM, + system_ce_path + "/backup_stage")) { + return false; + } } } return true;