From f90fc9c557ef2ec080bad921720466d6bf479845 Mon Sep 17 00:00:00 2001 From: Zheng Yongjun Date: Mon, 24 Jan 2022 15:48:43 +0800 Subject: [PATCH] =?UTF-8?q?fixed=2064ed3f0=20from=20https://gitee.com/ccll?= =?UTF-8?q?ee/startup=5Fappspawn/pulls/76=20=E4=BD=BF=E7=94=A8=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E7=94=A8=E6=88=B7ID=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E5=86=99=E6=AD=BBID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zheng Yongjun Change-Id: I07c01b6428ab8aa457351d0d23d9b5036febe12a --- src/appspawn_server.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index b4ef590d..a19648c7 100644 --- a/src/appspawn_server.cpp +++ b/src/appspawn_server.cpp @@ -453,12 +453,13 @@ int32_t AppSpawnServer::DoAppSandboxMountOnce(const std::string originPath, cons int32_t AppSpawnServer::DoAppSandboxMount(const ClientSocket::AppProperty *appProperty, std::string rootPath) { + std::string currentUserId = std::to_string(appProperty->uid / 200000); std::string oriInstallPath = "/data/app/el1/bundle/"; - std::string oriDataPath = "/data/app/el2/0/base/"; - std::string oriDatabasePath = "/data/app/el2/0/database/"; + std::string oriDataPath = "/data/app/el2/" + currentUserId + "/base/"; + std::string oriDatabasePath = "/data/app/el2/" + currentUserId + "/database/"; std::string destAPI7InstallPath = rootPath + "/data/accounts/account_0/applications"; std::string destDatabasePath = rootPath + "/data/storage/el2/database"; - std::string destInstallPath = rootPath + "/data/storage/el1/0/bundle"; + std::string destInstallPath = rootPath + "/data/storage/el1/bundle"; std::string destDataPath = rootPath + "/data/storage/el2/base"; int rc = 0; @@ -481,6 +482,18 @@ int32_t AppSpawnServer::DoAppSandboxMount(const ClientSocket::AppProperty *appPr } } + // Add distributedfile module support, later reconstruct it + std::string oriDistributedPath = "/mnt/hmdfs/" + currentUserId + "/merge_view/data/" + bundleName; + std::string destDistributedPath = rootPath + "/data/storage/el2/distributedfiles"; + DoAppSandboxMountOnce(oriDistributedPath.c_str(), destDistributedPath.c_str()); + + std::string oriDistributedGroupPath = "/mnt/hmdfs/auth_groups/" + currentUserId + "/merge_view/data/" + bundleName; + std::string destDistributedGroupPath = rootPath + "/data/storage/el2/accountless_distributedfile"; + DoAppSandboxMountOnce(oriDistributedGroupPath.c_str(), destDistributedGroupPath.c_str()); + + std::string oriMediaPath = "/storage/media/" + currentUserId; + std::string destMediaPath = rootPath + "/storage/media"; + DoAppSandboxMountOnce(oriMediaPath.c_str(), destMediaPath.c_str()); return 0; } @@ -494,9 +507,9 @@ void AppSpawnServer::DoAppSandboxMkdir(std::string sandboxPackagePath, const Cli mkdir(dirPath.c_str(), FILE_MODE); dirPath = sandboxPackagePath + "/data/storage/el1"; mkdir(dirPath.c_str(), FILE_MODE); - dirPath = sandboxPackagePath + "/data/storage/el1/0"; + dirPath = sandboxPackagePath + "/data/storage/el1"; mkdir(dirPath.c_str(), FILE_MODE); - dirPath = sandboxPackagePath + "/data/storage/el1/0/bundle"; + dirPath = sandboxPackagePath + "/data/storage/el1/bundle"; mkdir(dirPath.c_str(), FILE_MODE); // to create /mnt/sandbox//data/storage/el1 related path, later should delete this code. @@ -507,6 +520,10 @@ void AppSpawnServer::DoAppSandboxMkdir(std::string sandboxPackagePath, const Cli mkdir(dirPath.c_str(), FILE_MODE); dirPath = sandboxPackagePath + "/data/storage/el2/database"; mkdir(dirPath.c_str(), FILE_MODE); + dirPath = sandboxPackagePath + "/data/storage/el2/distributedfiles"; + mkdir(dirPath.c_str(), FILE_MODE); + dirPath = sandboxPackagePath + "/data/storage/el2/accountless_distributedfile"; + mkdir(dirPath.c_str(), FILE_MODE); } int32_t AppSpawnServer::SetAppSandboxProperty(const ClientSocket::AppProperty *appProperty) -- Gitee