Update shared sandbox directory structure.
Sandboxes for apps with sharedUserIds will live
at Android/shared:sharedUserId/ instead of
Android/shared/sharedUserId/.
Bug: 117573457
Test: manual
Change-Id: I7ab920814b501b9cdd4c58fefe81c53162b318f3
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 45158fe..5b0f073 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -568,13 +568,6 @@
if (sandboxRoot.empty()) {
return -errno;
}
- std::string sharedSandboxRoot;
- StringAppendF(&sharedSandboxRoot, "%s/shared", sandboxRoot.c_str());
- // Create shared sandbox base dir for apps with sharedUserIds
- if (fs_prepare_dir(sharedSandboxRoot.c_str(), 0700, AID_ROOT, AID_ROOT) != 0) {
- PLOG(ERROR) << "fs_prepare_dir failed on " << sharedSandboxRoot;
- return -errno;
- }
if (!createPkgSpecificDirRoots(volumeRoot)) {
return -errno;
@@ -691,11 +684,7 @@
std::string VolumeManager::prepareSandboxSource(uid_t uid, const std::string& sandboxId,
const std::string& sandboxRootDir) {
std::string sandboxSourceDir(sandboxRootDir);
- if (StartsWith(sandboxId, "shared:")) {
- StringAppendF(&sandboxSourceDir, "/shared/%s", sandboxId.substr(7).c_str());
- } else {
- StringAppendF(&sandboxSourceDir, "/%s", sandboxId.c_str());
- }
+ StringAppendF(&sandboxSourceDir, "/%s", sandboxId.c_str());
if (fs_prepare_dir(sandboxSourceDir.c_str(), 0755, uid, uid) != 0) {
PLOG(ERROR) << "fs_prepare_dir failed on " << sandboxSourceDir;
return kEmptyString;
@@ -915,11 +904,7 @@
if (volLabel == mPrimary->getLabel() && mPrimary->isEmulated()) {
StringAppendF(&sandboxDir, "/%d", userId);
}
- if (StartsWith(sandboxId, "shared:")) {
- StringAppendF(&sandboxDir, "/Android/sandbox/shared/%s", sandboxId.substr(7).c_str());
- } else {
- StringAppendF(&sandboxDir, "/Android/sandbox/%s", sandboxId.c_str());
- }
+ StringAppendF(&sandboxDir, "/Android/sandbox/%s", sandboxId.c_str());
if (android::vold::DeleteDirContentsAndDir(sandboxDir) < 0) {
PLOG(ERROR) << "DeleteDirContentsAndDir failed on " << sandboxDir;