From f6b32509d30bff71d9ee86af78ad07fc4128d0ee Mon Sep 17 00:00:00 2001 From: nianyuu Date: Thu, 8 May 2025 00:42:15 +0800 Subject: [PATCH] fix umount bug Signed-off-by: nianyuu --- modules/sandbox/sandbox_shared_mount.cpp | 23 ++++++---- modules/sandbox/sandbox_utils.cpp | 43 ++++++++++++++----- modules/sandbox/sandbox_utils.h | 16 ++++--- .../app_spawn_sandbox_test.cpp | 36 ++++++++-------- 4 files changed, 75 insertions(+), 43 deletions(-) diff --git a/modules/sandbox/sandbox_shared_mount.cpp b/modules/sandbox/sandbox_shared_mount.cpp index 58f2635c..35da5beb 100644 --- a/modules/sandbox/sandbox_shared_mount.cpp +++ b/modules/sandbox/sandbox_shared_mount.cpp @@ -158,8 +158,12 @@ static bool SetSandboxPathShared(const std::string &sandboxPath) return true; } -static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info, const char *bundleName) +static int MountEl1Bundle(const AppSpawnMgr *content, const AppSpawningCtx *property, + const AppDacInfo *info, const char *bundleName) { + if (!IsAppSpawnMode(content)) { + return 0; + } /* /data/app/el1/bundle/public/ */ char sourcePath[PATH_MAX_LEN] = {0}; int ret = snprintf_s(sourcePath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/data/app/el1/bundle/public/%s", bundleName); @@ -177,17 +181,20 @@ static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info return APPSPAWN_ERROR_UTILS_MEM_FAIL; } + // Check whether the directory is a shared mount point + if (SetSandboxPathShared(targetPath)) { + std::string key = std::to_string(info->uid / UID_BASE) + "-" + std::string(bundleName); + g_mountInfoMap[key]++; + APPSPAWN_LOGI("shared mountpoint is exist, %{public}s: %{public}d", key.c_str(), g_mountInfoMap[key]); + return 0; + } + ret = MakeDirRec(targetPath, DIR_MODE, 1); if (ret != 0) { APPSPAWN_LOGE("mkdir %{public}s failed, errno %{public}d", targetPath, errno); return APPSPAWN_SANDBOX_ERROR_MKDIR_FAIL; } - ret = umount2(targetPath, MNT_DETACH); - if (ret != 0) { - APPSPAWN_LOGE("umount2 %{public}s failed, errno %{public}d", targetPath, errno); - } - SharedMountArgs arg = { .srcPath = sourcePath, .destPath = targetPath, @@ -551,7 +558,7 @@ int UpdateDataGroupDirs(AppSpawnMgr *content) static void MountDirToShared(AppSpawnMgr *content, const AppSpawningCtx *property) { - if (property == nullptr) { + if (content == nullptr || property == nullptr) { return; } @@ -562,7 +569,7 @@ static void MountDirToShared(AppSpawnMgr *content, const AppSpawningCtx *propert return; } - MountEl1Bundle(property, info, bundleInfo->bundleName); + MountEl1Bundle(content, property, info, bundleInfo->bundleName); if (IsUnlockStatus(info->uid)) { return; diff --git a/modules/sandbox/sandbox_utils.cpp b/modules/sandbox/sandbox_utils.cpp index 5f3f5934..b8f00694 100644 --- a/modules/sandbox/sandbox_utils.cpp +++ b/modules/sandbox/sandbox_utils.cpp @@ -1135,7 +1135,8 @@ int32_t SandboxUtils::DoSandboxFileCommonFlagsPointHandle(const AppSpawningCtx * return 0; } -int32_t SandboxUtils::DoSandboxFileCommonBind(const AppSpawningCtx *appProperty, nlohmann::json &wholeConfig) +int32_t SandboxUtils::DoSandboxFileCommonBind(const AppSpawnMgr *content, const AppSpawningCtx *appProperty, + nlohmann::json &wholeConfig) { nlohmann::json& commonConfig = wholeConfig[g_commonPrefix][0]; int ret = 0; @@ -1147,6 +1148,13 @@ int32_t SandboxUtils::DoSandboxFileCommonBind(const AppSpawningCtx *appProperty, } } + if (!IsAppSpawnMode(content)) { + ret = MountDataEl1Bundle(appProperty); + if (ret) { + return ret; + } + } + if (commonConfig.find(g_appResources) != commonConfig.end()) { ret = DoAllMntPointsMount(appProperty, commonConfig[g_appResources][0], nullptr, g_appResources); } @@ -1288,12 +1296,11 @@ int32_t SandboxUtils::SetPermissionAppSandboxProperty(AppSpawningCtx *appPropert } -int32_t SandboxUtils::SetCommonAppSandboxProperty_(const AppSpawningCtx *appProperty, +int32_t SandboxUtils::SetCommonAppSandboxProperty_(const AppSpawnMgr *content, const AppSpawningCtx *appProperty, nlohmann::json &config) { int rc = 0; - - rc = DoSandboxFileCommonBind(appProperty, config); + rc = DoSandboxFileCommonBind(content, appProperty, config); APPSPAWN_CHECK(rc == 0, return rc, "DoSandboxFileCommonBind failed, %{public}s", GetBundleName(appProperty)); // if sandbox switch is off, don't do symlink work again @@ -1308,7 +1315,7 @@ int32_t SandboxUtils::SetCommonAppSandboxProperty_(const AppSpawningCtx *appProp return rc; } -int32_t SandboxUtils::SetCommonAppSandboxProperty(const AppSpawningCtx *appProperty, +int32_t SandboxUtils::SetCommonAppSandboxProperty(const AppSpawnMgr *content, const AppSpawningCtx *appProperty, std::string &sandboxPackagePath) { int ret = 0; @@ -1316,7 +1323,7 @@ int32_t SandboxUtils::SetCommonAppSandboxProperty(const AppSpawningCtx *appPrope SANBOX_ISOLATED_JSON_CONFIG : SANBOX_APP_JSON_CONFIG; for (auto& jsonConfig : SandboxUtils::GetJsonConfig(type)) { - ret = SetCommonAppSandboxProperty_(appProperty, jsonConfig); + ret = SetCommonAppSandboxProperty_(content, appProperty, jsonConfig); APPSPAWN_CHECK(ret == 0, return ret, "parse appdata config for common failed, %{public}s", sandboxPackagePath.c_str()); } @@ -1357,6 +1364,18 @@ std::string SandboxUtils::GetExtraInfoByType(const AppSpawningCtx *appProperty, return std::string(info, len); } +int32_t SandboxUtils::MountDataEl1Bundle(const AppSpawningCtx *appProperty) +{ + AppSpawnMsgDacInfo *dacInfo = reinterpret_cast(GetAppProperty(appProperty, TLV_DAC_INFO)); + APPSPAWN_CHECK(dacInfo != NULL, return -1, "No dac info in msg app property"); + + std::string bundleName = GetBundleName(appProperty); + std::string srcPath = "/data/app/el1/bundle/public/" + bundleName; + std::string mntPath = "/mnt/sandbox/" + std::to_string(dacInfo->uid / UID_BASE) + + "/" + bundleName + "/data/storage/el1/bundle"; + return DoAppSandboxMountOnce(srcPath.c_str(), mntPath.c_str(), "", BASIC_MOUNT_FLAGS, nullptr); +} + int32_t SandboxUtils::MountAllHsp(const AppSpawningCtx *appProperty, std::string &sandboxPackagePath) { int ret = 0; @@ -1652,11 +1671,12 @@ int32_t SandboxUtils::CheckAppFullMountEnable() return deviceTypeEnable_; } -int32_t SandboxUtils::SetSandboxProperty(AppSpawningCtx *appProperty, std::string &sandboxPackagePath) +int32_t SandboxUtils::SetSandboxProperty(const AppSpawnMgr *content, AppSpawningCtx *appProperty, + std::string &sandboxPackagePath) { int32_t ret = 0; const std::string bundleName = GetBundleName(appProperty); - ret = SetCommonAppSandboxProperty(appProperty, sandboxPackagePath); + ret = SetCommonAppSandboxProperty(content, appProperty, sandboxPackagePath); APPSPAWN_CHECK(ret == 0, return ret, "SetCommonAppSandboxProperty failed, packagename is %{public}s", bundleName.c_str()); if (CheckBundleNameForPrivate(bundleName)) { @@ -1774,7 +1794,8 @@ void SandboxUtils::MountDevShmPath(std::string &sandboxPath) } #endif -int32_t SandboxUtils::SetAppSandboxProperty(AppSpawningCtx *appProperty, uint32_t sandboxNsFlags) +int32_t SandboxUtils::SetAppSandboxProperty(AppSpawnMgr *content, AppSpawningCtx *appProperty, + uint32_t sandboxNsFlags) { APPSPAWN_CHECK(appProperty != nullptr, return -1, "Invalid appspwn client"); if (CheckBundleName(GetBundleName(appProperty)) != 0) { @@ -1810,7 +1831,7 @@ int32_t SandboxUtils::SetAppSandboxProperty(AppSpawningCtx *appProperty, uint32_ rc = DoSandboxRootFolderCreate(appProperty, sandboxPackagePath); } APPSPAWN_CHECK(rc == 0, return rc, "DoSandboxRootFolderCreate failed, %{public}s", bundleName.c_str()); - rc = SetSandboxProperty(appProperty, sandboxPackagePath); + rc = SetSandboxProperty(content, appProperty, sandboxPackagePath); APPSPAWN_CHECK(rc == 0, return rc, "SetSandboxProperty failed, %{public}s", bundleName.c_str()); #ifdef APPSPAWN_MOUNT_TMPSHM @@ -1989,7 +2010,7 @@ int32_t SetAppSandboxProperty(AppSpawnMgr *content, AppSpawningCtx *property) if (IsNWebSpawnMode(content)) { ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxPropertyNweb(property, sandboxNsFlags); } else { - ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(property, sandboxNsFlags); + ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(content, property, sandboxNsFlags); } // for module test do not create sandbox, use APP_FLAGS_IGNORE_SANDBOX to ignore sandbox result if (CheckAppMsgFlagsSet(property, APP_FLAGS_IGNORE_SANDBOX)) { diff --git a/modules/sandbox/sandbox_utils.h b/modules/sandbox/sandbox_utils.h index 1ad93280..f51a0694 100755 --- a/modules/sandbox/sandbox_utils.h +++ b/modules/sandbox/sandbox_utils.h @@ -37,7 +37,8 @@ class SandboxUtils { public: static void StoreJsonConfig(nlohmann::json &appSandboxConfig, SandboxConfigType type); static std::vector &GetJsonConfig(SandboxConfigType type); - static int32_t SetAppSandboxProperty(AppSpawningCtx *client, uint32_t sandboxNsFlags = CLONE_NEWNS); + static int32_t SetAppSandboxProperty(AppSpawnMgr *content, AppSpawningCtx *client, + uint32_t sandboxNsFlags = CLONE_NEWNS); static int32_t SetAppSandboxPropertyNweb(AppSpawningCtx *client, uint32_t sandboxNsFlags = CLONE_NEWNS); static uint32_t GetSandboxNsFlags(bool isNweb); static std::set GetMountPermissionNames(); @@ -55,7 +56,8 @@ private: static int32_t DoAppSandboxMountOnce(const char *originPath, const char *destinationPath, const char *fsType, unsigned long mountFlags, const char *options, mode_t mountSharedFlag = MS_SLAVE); - static int32_t DoSandboxFileCommonBind(const AppSpawningCtx *appProperty, nlohmann::json &wholeConfig); + static int32_t DoSandboxFileCommonBind(const AppSpawnMgr *content, const AppSpawningCtx *appProperty, + nlohmann::json &wholeConfig); static int32_t DoSandboxFileCommonSymlink(const AppSpawningCtx *appProperty, nlohmann::json &wholeConfig); static int32_t DoSandboxFilePrivateBind(const AppSpawningCtx *appProperty, nlohmann::json &wholeConfig); @@ -68,8 +70,9 @@ private: static int32_t HandleFlagsPoint(const AppSpawningCtx *appProperty, nlohmann::json &wholeConfig); static int32_t SetPrivateAppSandboxProperty(const AppSpawningCtx *appProperty); - static int32_t SetCommonAppSandboxProperty(const AppSpawningCtx *appProperty, - std::string &sandboxPackagePath); + static int32_t SetCommonAppSandboxProperty(const AppSpawnMgr *content, const AppSpawningCtx *appProperty, + std::string &sandboxPackagePath); + static int32_t MountDataEl1Bundle(const AppSpawningCtx *appProperty); static int32_t MountAllHsp(const AppSpawningCtx *appProperty, std::string &sandboxPackagePath); static int32_t MountAllGroup(const AppSpawningCtx *appProperty, std::string &sandboxPackagePath); static int32_t DoSandboxRootFolderCreateAdapt(std::string &sandboxPackagePath); @@ -87,7 +90,7 @@ private: static bool CheckBundleNameForPrivate(const std::string &bundleName); static bool GetSbxSwitchStatusByConfig(nlohmann::json &config); static unsigned long GetMountFlagsFromConfig(const std::vector &vec); - static int32_t SetCommonAppSandboxProperty_(const AppSpawningCtx *appProperty, + static int32_t SetCommonAppSandboxProperty_(const AppSpawnMgr *content, const AppSpawningCtx *appProperty, nlohmann::json &config); static int32_t SetPrivateAppSandboxProperty_(const AppSpawningCtx *appProperty, nlohmann::json &config); @@ -109,7 +112,8 @@ private: static int32_t CheckAppFullMountEnable(); static void UpdateMsgFlagsWithPermission(AppSpawningCtx *appProperty); static int32_t UpdatePermissionFlags(AppSpawningCtx *appProperty); - static int32_t SetSandboxProperty(AppSpawningCtx *appProperty, std::string &sandboxPackagePath); + static int32_t SetSandboxProperty(const AppSpawnMgr *content, AppSpawningCtx *appProperty, + std::string &sandboxPackagePath); static int32_t ChangeCurrentDir(std::string &sandboxPackagePath, const std::string &bundleName, bool sandboxSharedStatus); static int32_t GetMountPermissionFlags(const std::string permissionName); diff --git a/test/unittest/app_spawn_standard_test/app_spawn_sandbox_test.cpp b/test/unittest/app_spawn_standard_test/app_spawn_sandbox_test.cpp index 5d6bba80..52faae40 100644 --- a/test/unittest/app_spawn_standard_test/app_spawn_sandbox_test.cpp +++ b/test/unittest/app_spawn_standard_test/app_spawn_sandbox_test.cpp @@ -89,7 +89,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_08, TestSize.Level0) g_testHelper.SetTestGid(1000); // 1000 test g_testHelper.SetProcessName("ohos.samples.ecg"); AppSpawningCtx *appProperty = GetTestAppProperty(); - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_08 end"; } @@ -107,7 +107,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_09, TestSize.Level0) g_testHelper.SetProcessName("com.ohos.dlpmanager"); g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_09 end"; } @@ -120,7 +120,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_09_1, TestSize.Level0) g_testHelper.SetProcessName("com.ohos.dlpmanager"); g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); - int ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr); + int ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, nullptr); EXPECT_NE(ret, 0); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_09_1 end"; @@ -135,7 +135,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_09_2, TestSize.Level0) g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); - int ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + int ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); EXPECT_NE(ret, 0); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_09_1 end"; @@ -149,7 +149,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_09_3, TestSize.Level0) g_testHelper.SetProcessName("com.\\ohos.dlpmanager"); g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); - int ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + int ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); EXPECT_NE(ret, 0); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_09_1 end"; @@ -163,7 +163,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_09_4, TestSize.Level0) g_testHelper.SetProcessName("com./ohos.dlpmanager"); g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); - int ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + int ret = OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); EXPECT_NE(ret, 0); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_09_1 end"; @@ -206,7 +206,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_10, TestSize.Level0) g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); GTEST_LOG_(INFO) << "SetAppSandboxProperty section 2" << std::endl; - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_10 end"; } @@ -247,7 +247,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_13, TestSize.Level0) g_testHelper.SetProcessName("test.appspawn"); g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_13 end"; } @@ -290,7 +290,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_14, TestSize.Level0) AppSpawningCtx *appProperty = GetTestAppProperty(); GTEST_LOG_(INFO) << "SetAppSandboxProperty section 2" << std::endl; - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_14 end"; } @@ -332,7 +332,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_15, TestSize.Level0) g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); GTEST_LOG_(INFO) << "SetAppSandboxProperty section 2" << std::endl; - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_15 end"; } @@ -366,7 +366,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_16, TestSize.Level0) g_testHelper.SetProcessName("test.appspawn"); g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); DeleteAppSpawningCtx(appProperty); GTEST_LOG_(INFO) << "App_Spawn_Sandbox_16 end"; } @@ -448,7 +448,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_20, TestSize.Level0) g_testHelper.SetTestApl("normal"); AppSpawningCtx *appProperty = GetTestAppProperty(); - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); std::string mJsconfig1 = "{ \ \"common\":[{ \ @@ -466,7 +466,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_20, TestSize.Level0) }"; nlohmann::json j_config1 = nlohmann::json::parse(mJsconfig1.c_str()); OHOS::AppSpawn::SandboxUtils::StoreJsonConfig(j_config1, SANBOX_APP_JSON_CONFIG); - OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(appProperty); + OHOS::AppSpawn::SandboxUtils::SetAppSandboxProperty(nullptr, appProperty); DeleteAppSpawningCtx(appProperty); } @@ -496,7 +496,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_22, TestSize.Level0) const char *strl1 = "/mnt/sandbox/100/test.bundle1"; std::string testBundle = strl1; - int ret = OHOS::AppSpawn::SandboxUtils::SetCommonAppSandboxProperty(appProperty, testBundle); + int ret = OHOS::AppSpawn::SandboxUtils::SetCommonAppSandboxProperty(nullptr, appProperty, testBundle); DeleteAppSpawningCtx(appProperty); EXPECT_EQ(ret, 0); } @@ -596,7 +596,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_25, TestSize.Level0) }] \ }"; nlohmann::json j_config1 = nlohmann::json::parse(mJsconfig1.c_str()); - int ret = OHOS::AppSpawn::SandboxUtils::DoSandboxFileCommonBind(appProperty, j_config1); + int ret = OHOS::AppSpawn::SandboxUtils::DoSandboxFileCommonBind(nullptr, appProperty, j_config1); EXPECT_EQ(ret, 0); ret = OHOS::AppSpawn::SandboxUtils::DoSandboxFileCommonFlagsPointHandle(appProperty, j_config1); @@ -627,7 +627,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_26, TestSize.Level0) }] \ }"; nlohmann::json j_config2 = nlohmann::json::parse(mJsconfig2.c_str()); - int ret = OHOS::AppSpawn::SandboxUtils::DoSandboxFileCommonBind(appProperty, j_config2); + int ret = OHOS::AppSpawn::SandboxUtils::DoSandboxFileCommonBind(nullptr, appProperty, j_config2); DeleteAppSpawningCtx(appProperty); EXPECT_NE(ret, 0); } @@ -1070,7 +1070,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_37, TestSize.Level0) int ret = SandboxUtils::SetPrivateAppSandboxProperty(appProperty); EXPECT_EQ(0, ret); - ret = SandboxUtils::SetCommonAppSandboxProperty(appProperty, sandboxPackagePath); + ret = SandboxUtils::SetCommonAppSandboxProperty(nullptr, appProperty, sandboxPackagePath); DeleteAppSpawningCtx(appProperty); EXPECT_EQ(0, ret); APPSPAWN_LOGI("App_Spawn_Sandbox_37 end"); @@ -1116,7 +1116,7 @@ HWTEST_F(AppSpawnSandboxTest, App_Spawn_Sandbox_38, TestSize.Level0) sandboxPackagePath += bundleName; int ret = SandboxUtils::SetPrivateAppSandboxProperty(appProperty); EXPECT_EQ(0, ret); - ret = SandboxUtils::SetCommonAppSandboxProperty(appProperty, sandboxPackagePath); + ret = SandboxUtils::SetCommonAppSandboxProperty(nullptr, appProperty, sandboxPackagePath); DeleteAppSpawningCtx(appProperty); EXPECT_EQ(0, ret); APPSPAWN_LOGI("App_Spawn_Sandbox_38 end"); -- Gitee