From 4e074467d7dd0b1a68d6526161bdd70d9b920b96 Mon Sep 17 00:00:00 2001 From: wangfenging Date: Mon, 9 Jun 2025 18:02:33 +0800 Subject: [PATCH] Fix:clone hap mount /storage/Users fail Signed-off-by: wangfenging --- modules/sandbox/sandbox_shared_mount.cpp | 93 +++++++------------ modules/sandbox/sandbox_utils.cpp | 36 ++----- standard/appspawn_appmgr.c | 3 +- standard/appspawn_manager.h | 3 +- standard/appspawn_service.c | 9 +- .../app_spawn_appmgr_test.cpp | 10 +- .../app_spawn_module_interface_test.cpp | 2 +- 7 files changed, 53 insertions(+), 103 deletions(-) diff --git a/modules/sandbox/sandbox_shared_mount.cpp b/modules/sandbox/sandbox_shared_mount.cpp index c752a28b..c72f5165 100644 --- a/modules/sandbox/sandbox_shared_mount.cpp +++ b/modules/sandbox/sandbox_shared_mount.cpp @@ -157,27 +157,20 @@ static bool SetSandboxPathShared(const std::string &sandboxPath) return true; } -static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info, const char *varBundleName) +static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info, const char *bundleName) { /* /data/app/el1/bundle/public/ */ - AppSpawnMsgBundleInfo *bundleInfo = - reinterpret_cast(GetAppProperty(property, TLV_BUNDLE_INFO)); - if (bundleInfo == nullptr) { - return APPSPAWN_SANDBOX_INVALID; - } char sourcePath[PATH_MAX_LEN] = {0}; - int ret = snprintf_s(sourcePath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/data/app/el1/bundle/public/%s", - bundleInfo->bundleName); + int ret = snprintf_s(sourcePath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/data/app/el1/bundle/public/%s", bundleName); if (ret <= 0) { - APPSPAWN_LOGE("snprintf data/app/el1/bundle/public/%{public}s failed, errno %{public}d", - bundleInfo->bundleName, errno); + APPSPAWN_LOGE("snprintf data/app/el1/bundle/public/%{public}s failed, errno %{public}d", bundleName, errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; } - /* /mnt/sandbox///data/storage/el1/bundle */ + /* /mnt/sandbox///data/storage/el1/bundle */ char targetPath[PATH_MAX_LEN] = {0}; ret = snprintf_s(targetPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/mnt/sandbox/%u/%s/data/storage/el1/bundle", - info->uid/ UID_BASE, varBundleName); + info->uid/ UID_BASE, bundleName); if (ret <= 0) { APPSPAWN_LOGE("snprintf el1 bundle sandbox path failed, errno %{public}d", errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; @@ -206,12 +199,12 @@ static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info if (ret != 0) { APPSPAWN_LOGE("mount %{public}s shared failed, ret %{public}d", targetPath, ret); } - std::string key = std::to_string(info->uid / UID_BASE) + "-" + std::string(varBundleName); + std::string key = std::to_string(info->uid / UID_BASE) + "-" + std::string(bundleName); g_mountInfoMap[key]++; return ret; } -static int MountWithFileMgr(const AppSpawningCtx *property, const AppDacInfo *info, const char *varBundleName) +static int MountWithFileMgr(const AppSpawningCtx *property, const AppDacInfo *info, const char *bundleName) { /* /mnt/user//nosharefs/docs */ char nosharefsDocsDir[PATH_MAX_LEN] = {0}; @@ -222,10 +215,10 @@ static int MountWithFileMgr(const AppSpawningCtx *property, const AppDacInfo *in return APPSPAWN_ERROR_UTILS_MEM_FAIL; } - /* /mnt/sandbox//storage/Users */ + /* /mnt/sandbox//storage/Users */ char storageUserPath[PATH_MAX_LEN] = {0}; ret = snprintf_s(storageUserPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/mnt/sandbox/%u/%s/storage/Users", - info->uid / UID_BASE, varBundleName); + info->uid / UID_BASE, bundleName); if (ret <= 0) { APPSPAWN_LOGE("snprintf storageUserPath failed, errno %{public}d", errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; @@ -258,7 +251,7 @@ static int MountWithFileMgr(const AppSpawningCtx *property, const AppDacInfo *in return ret; } -static int MountWithOther(const AppSpawningCtx *property, const AppDacInfo *info, const char *varBundleName) +static int MountWithOther(const AppSpawningCtx *property, const AppDacInfo *info, const char *bundleName) { /* /mnt/user//sharefs/docs */ char sharefsDocsDir[PATH_MAX_LEN] = {0}; @@ -269,10 +262,10 @@ static int MountWithOther(const AppSpawningCtx *property, const AppDacInfo *info return APPSPAWN_ERROR_UTILS_MEM_FAIL; } - /* /mnt/sandbox//storage/Users */ + /* /mnt/sandbox//storage/Users */ char storageUserPath[PATH_MAX_LEN] = {0}; ret = snprintf_s(storageUserPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/mnt/sandbox/%u/%s/storage/Users", - info->uid / UID_BASE, varBundleName); + info->uid / UID_BASE, bundleName); if (ret <= 0) { APPSPAWN_LOGE("snprintf storageUserPath failed, errno %{public}d", errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; @@ -313,18 +306,17 @@ static int MountWithOther(const AppSpawningCtx *property, const AppDacInfo *info return ret; } -static void MountStorageUsers(const AppSpawningCtx *property, const AppDacInfo *info, const char *varBundleName) +static void MountStorageUsers(const AppSpawningCtx *property, const AppDacInfo *info, const char *bundleName) { int ret = 0; int index = GetPermissionIndex(nullptr, "ohos.permission.FILE_ACCESS_MANAGER"); int checkRes = CheckAppPermissionFlagSet(property, static_cast(index)); if (checkRes == 0) { - /* mount /mnt/user//sharefs/docs to /mnt/sandbox///storage/Users */ - ret = MountWithOther(property, info, varBundleName); + /* mount /mnt/user//sharefs/docs to /mnt/sandbox///storage/Users */ + ret = MountWithOther(property, info, bundleName); } else { - /* mount /mnt/user//nosharefs/docs to /mnt/sandbox///storage/Users - */ - ret = MountWithFileMgr(property, info, varBundleName); + /* mount /mnt/user//nosharefs/docs to /mnt/sandbox///storage/Users */ + ret = MountWithFileMgr(property, info, bundleName); } if (ret != 0) { APPSPAWN_LOGE("Update %{public}s storage dir failed, ret %{public}d", @@ -334,13 +326,13 @@ static void MountStorageUsers(const AppSpawningCtx *property, const AppDacInfo * } } -static int MountSharedMapItem(const AppSpawningCtx *property, const AppDacInfo *info, const char *varBundleName, +static int MountSharedMapItem(const AppSpawningCtx *property, const AppDacInfo *info, const char *bundleName, const char *sandboxPathItem) { - /* /mnt/sandbox///data/storage/el */ + /* /mnt/sandbox///data/storage/el */ char sandboxPath[PATH_MAX_LEN] = {0}; int ret = snprintf_s(sandboxPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/mnt/sandbox/%u/%s%s", - info->uid / UID_BASE, varBundleName, sandboxPathItem); + info->uid / UID_BASE, bundleName, sandboxPathItem); if (ret <= 0) { APPSPAWN_LOGE("snprintf sandboxPath failed, errno %{public}d", errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; @@ -373,17 +365,17 @@ static int MountSharedMapItem(const AppSpawningCtx *property, const AppDacInfo * return ret; } -static void MountSharedMap(const AppSpawningCtx *property, const AppDacInfo *info, const char *varBundleName) +static void MountSharedMap(const AppSpawningCtx *property, const AppDacInfo *info, const char *bundleName) { int length = sizeof(MOUNT_SHARED_MAP) / sizeof(MOUNT_SHARED_MAP[0]); for (int i = 0; i < length; i++) { if (MOUNT_SHARED_MAP[i].permission == nullptr) { - MountSharedMapItem(property, info, varBundleName, MOUNT_SHARED_MAP[i].sandboxPath); + MountSharedMapItem(property, info, bundleName, MOUNT_SHARED_MAP[i].sandboxPath); } else { int index = GetPermissionIndex(nullptr, MOUNT_SHARED_MAP[i].permission); APPSPAWN_LOGV("mount dir on lock mountPermissionFlags %{public}d", index); if (CheckAppPermissionFlagSet(property, static_cast(index))) { - MountSharedMapItem(property, info, varBundleName, MOUNT_SHARED_MAP[i].sandboxPath); + MountSharedMapItem(property, info, bundleName, MOUNT_SHARED_MAP[i].sandboxPath); } } } @@ -467,7 +459,7 @@ static void DumpDataGroupCtxQueue(const ListNode *front) } static int ParseDataGroupList(AppSpawnMgr *content, const AppSpawningCtx *property, AppDacInfo *info, - const char *varBundleName) + AppSpawnMsgBundleInfo *bundleInfo) { int ret = 0; std::string dataGroupList = GetExtraInfoByType(property, DATA_GROUP_SOCKET_TYPE); @@ -503,8 +495,8 @@ static int ParseDataGroupList(AppSpawnMgr *content, const AppSpawningCtx *proper } } - // sandboxPath: /mnt/sandbox///data/storage/el/group - std::string sandboxPath = "/mnt/sandbox/" + std::to_string(info->uid / UID_BASE) + "/" + varBundleName + // sandboxPath: /mnt/sandbox///data/storage/el/group + std::string sandboxPath = "/mnt/sandbox/" + std::to_string(info->uid / UID_BASE) + "/" + bundleInfo->bundleName + templateItem->sandboxPath; ret = AddDataGroupItemToQueue(content, srcPath, sandboxPath, item[GROUPLIST_KEY_UUID]); @@ -556,23 +548,6 @@ int UpdateDataGroupDirs(AppSpawnMgr *content) return 0; } -static std::string ReplaceVarBundleName(const AppSpawningCtx *property) -{ - AppSpawnMsgBundleInfo *bundleInfo = - reinterpret_cast(GetAppProperty(property, TLV_BUNDLE_INFO)); - if (bundleInfo == nullptr) { - return ""; - } - - std::string tmpBundlePath = bundleInfo->bundleName; - std::ostringstream variablePackageName; - if (CheckAppSpawnMsgFlag(property->message, TLV_MSG_FLAGS, APP_FLAGS_CLONE_ENABLE)) { - variablePackageName << "+clone-" << bundleInfo->bundleIndex << "+" << bundleInfo->bundleName; - tmpBundlePath = variablePackageName.str(); - } - return tmpBundlePath; -} - static void MountDirToShared(AppSpawnMgr *content, const AppSpawningCtx *property) { if (property == nullptr) { @@ -580,26 +555,26 @@ static void MountDirToShared(AppSpawnMgr *content, const AppSpawningCtx *propert } AppDacInfo *info = reinterpret_cast(GetAppProperty(property, TLV_DAC_INFO)); - std::string varBundleName = ReplaceVarBundleName(property); - if (info == NULL || varBundleName == "") { - APPSPAWN_LOGE("Invalid app dac info or varBundleName"); + AppSpawnMsgBundleInfo *bundleInfo = + reinterpret_cast(GetAppProperty(property, TLV_BUNDLE_INFO)); + if (info == NULL || bundleInfo == NULL) { return; } - MountEl1Bundle(property, info, varBundleName.c_str()); + MountEl1Bundle(property, info, bundleInfo->bundleName); if (IsUnlockStatus(info->uid)) { SetAppSpawnMsgFlag(property->message, TLV_MSG_FLAGS, APP_FLAGS_UNLOCKED_STATUS); return; } - MountSharedMap(property, info, varBundleName.c_str()); - MountStorageUsers(property, info, varBundleName.c_str()); - ParseDataGroupList(content, property, info, varBundleName.c_str()); + MountSharedMap(property, info, bundleInfo->bundleName); + MountStorageUsers(property, info, bundleInfo->bundleName); + ParseDataGroupList(content, property, info, bundleInfo); std::string lockSbxPathStamp = "/mnt/sandbox/" + std::to_string(info->uid / UID_BASE) + "/"; lockSbxPathStamp += CheckAppMsgFlagsSet(property, APP_FLAGS_ISOLATED_SANDBOX_TYPE) ? "isolated/" : ""; - lockSbxPathStamp += varBundleName; + lockSbxPathStamp += bundleInfo->bundleName; lockSbxPathStamp += "_locked"; int ret = MakeDirRec(lockSbxPathStamp.c_str(), DIR_MODE, 1); if (ret != 0) { diff --git a/modules/sandbox/sandbox_utils.cpp b/modules/sandbox/sandbox_utils.cpp index 777da7a5..d84b281d 100644 --- a/modules/sandbox/sandbox_utils.cpp +++ b/modules/sandbox/sandbox_utils.cpp @@ -668,32 +668,20 @@ std::string SandboxUtils::GetSbxPathByConfig(const AppSpawningCtx *appProperty, } std::string sandboxRoot = ""; - const std::string sandboxRootPathTemplate = "/mnt/sandbox//"; const std::string originSandboxPath = "/mnt/sandbox/"; std::string isolatedFlagText = CheckAppMsgFlagsSet(appProperty, APP_FLAGS_ISOLATED_SANDBOX_TYPE) ? "isolated/" : ""; - AppSpawnMsgBundleInfo *bundleInfo = - reinterpret_cast(GetAppProperty(appProperty, TLV_BUNDLE_INFO)); - if (bundleInfo == nullptr) { - return ""; - } - std::string tmpBundlePath = bundleInfo->bundleName; - std::ostringstream variablePackageName; - if (CheckAppSpawnMsgFlag(appProperty->message, TLV_MSG_FLAGS, APP_FLAGS_CLONE_ENABLE)) { - variablePackageName << "+clone-" << bundleInfo->bundleIndex << "+" << bundleInfo->bundleName; - tmpBundlePath = variablePackageName.str(); - } - const std::string variableSandboxRoot = g_sandBoxDir + to_string(dacInfo->uid / UID_BASE) + - "/" + isolatedFlagText.c_str() + tmpBundlePath; + const std::string defaultSandboxRoot = g_sandBoxDir + to_string(dacInfo->uid / UID_BASE) + + "/" + isolatedFlagText.c_str() + GetBundleName(appProperty); if (config.find(g_sandboxRootPrefix) != config.end()) { sandboxRoot = config[g_sandboxRootPrefix].get(); - if (sandboxRoot == originSandboxPath || sandboxRoot == sandboxRootPathTemplate) { - sandboxRoot = variableSandboxRoot; + if (sandboxRoot == originSandboxPath) { + sandboxRoot = defaultSandboxRoot; } else { sandboxRoot = ConvertToRealPath(appProperty, sandboxRoot); APPSPAWN_LOGV("set sandbox-root name is %{public}s", sandboxRoot.c_str()); } } else { - sandboxRoot = variableSandboxRoot; + sandboxRoot = defaultSandboxRoot; APPSPAWN_LOGV("set sandbox-root to default rootapp name is %{public}s", GetBundleName(appProperty)); } @@ -1823,13 +1811,14 @@ int32_t SandboxUtils::SetAppSandboxProperty(AppSpawningCtx *appProperty, uint32_ return -1; } + std::string sandboxPackagePath = g_sandBoxRootDir + to_string(dacInfo->uid / UID_BASE) + "/"; const std::string bundleName = GetBundleName(appProperty); - nlohmann::json tmpJson = {}; - std::string sandboxPackagePath = GetSbxPathByConfig(appProperty, tmpJson); - MakeDirRecursiveWithClock(sandboxPackagePath.c_str(), FILE_MODE); bool sandboxSharedStatus = GetSandboxPrivateSharedStatus(bundleName, appProperty) || (CheckAppPermissionFlagSet(appProperty, static_cast(GetPermissionIndex(nullptr, ACCESS_DLP_FILE_MODE.c_str()))) != 0); + sandboxPackagePath += CheckAppMsgFlagsSet(appProperty, APP_FLAGS_ISOLATED_SANDBOX_TYPE) ? "isolated/" : ""; + sandboxPackagePath += bundleName; + MakeDirRecursiveWithClock(sandboxPackagePath.c_str(), FILE_MODE); // add pid to a new mnt namespace int rc = EnableSandboxNamespace(appProperty, sandboxNsFlags); @@ -2081,13 +2070,8 @@ static int UmountSandboxPath(const AppSpawnMgr *content, const AppSpawnedProcess const char rootPath[] = "/mnt/sandbox/"; const char el1Path[] = "/data/storage/el1/bundle"; - std::string varBundleName = std::string(appInfo->name); - if (appInfo->appIndex > 0) { - varBundleName = "+clone-" + std::to_string(appInfo->appIndex) + "+" + varBundleName; - } - uint32_t userId = appInfo->uid / UID_BASE; - std::string key = std::to_string(userId) + "-" + varBundleName; + std::string key = std::to_string(userId) + "-" + std::string(appInfo->name); map *el1BundleCountMap = static_cast*>(GetEl1BundleMountCount()); if (el1BundleCountMap == nullptr || el1BundleCountMap->find(key) == el1BundleCountMap->end()) { return 0; diff --git a/standard/appspawn_appmgr.c b/standard/appspawn_appmgr.c index 4aa77019..8d164161 100644 --- a/standard/appspawn_appmgr.c +++ b/standard/appspawn_appmgr.c @@ -146,7 +146,7 @@ static int AppInfoCompareProc(ListNode *node, ListNode *newNode) return node1->pid - node2->pid; } -AppSpawnedProcess *AddSpawnedProcess(pid_t pid, const char *processName, uint32_t appIndex, bool isDebuggable) +AppSpawnedProcess *AddSpawnedProcess(pid_t pid, const char *processName, bool isDebuggable) { APPSPAWN_CHECK(g_appSpawnMgr != NULL && processName != NULL, return NULL, "Invalid mgr or process name"); APPSPAWN_CHECK(pid > 0, return NULL, "Invalid pid for %{public}s", processName); @@ -159,7 +159,6 @@ AppSpawnedProcess *AddSpawnedProcess(pid_t pid, const char *processName, uint32_ node->max = 0; node->uid = 0; node->exitStatus = 0; - node->appIndex = appIndex; node->isDebuggable = isDebuggable; int ret = strcpy_s(node->name, len, processName); APPSPAWN_CHECK(ret == 0, free(node); diff --git a/standard/appspawn_manager.h b/standard/appspawn_manager.h index 39f6a785..7a86e0d5 100644 --- a/standard/appspawn_manager.h +++ b/standard/appspawn_manager.h @@ -103,7 +103,6 @@ typedef struct TagAppSpawnedProcess { AppSpawnMsgNode *message; #endif bool isDebuggable; - uint32_t appIndex; char name[0]; } AppSpawnedProcess; @@ -160,7 +159,7 @@ AppSpawnContent *GetAppSpawnContent(void); */ typedef void (*AppTraversal)(const AppSpawnMgr *mgr, AppSpawnedProcess *appInfo, void *data); void TraversalSpawnedProcess(AppTraversal traversal, void *data); -AppSpawnedProcess *AddSpawnedProcess(pid_t pid, const char *processName, uint32_t appIndex, bool isDebuggable); +AppSpawnedProcess *AddSpawnedProcess(pid_t pid, const char *processName, bool isDebuggable); AppSpawnedProcess *GetSpawnedProcess(pid_t pid); AppSpawnedProcess *GetSpawnedProcessByName(const char *name); void TerminateSpawnedProcess(AppSpawnedProcess *node); diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index 9a5c5795..4620a441 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -1075,14 +1075,7 @@ static void ProcessChildResponse(const WatcherHandle taskHandle, int fd, uint32_ // success bool isDebuggable = CheckAppMsgFlagsSet(property, APP_FLAGS_DEBUGGABLE); - uint32_t appIndex = 0; - if (CheckAppMsgFlagsSet(property, APP_FLAGS_CLONE_ENABLE)) { - AppSpawnMsgBundleInfo *bundleInfo = (AppSpawnMsgBundleInfo *)GetAppProperty(property, TLV_BUNDLE_INFO); - if (bundleInfo != NULL) { - appIndex = bundleInfo->bundleIndex; - } - } - AppSpawnedProcess *appInfo = AddSpawnedProcess(property->pid, GetBundleName(property), appIndex, isDebuggable); + AppSpawnedProcess *appInfo = AddSpawnedProcess(property->pid, GetBundleName(property), isDebuggable); if (appInfo) { AppSpawnMsgDacInfo *dacInfo = GetAppProperty(property, TLV_DAC_INFO); appInfo->uid = dacInfo != NULL ? dacInfo->uid : 0; diff --git a/test/unittest/app_spawn_standard_test/app_spawn_appmgr_test.cpp b/test/unittest/app_spawn_standard_test/app_spawn_appmgr_test.cpp index c4099de4..f6012a28 100644 --- a/test/unittest/app_spawn_standard_test/app_spawn_appmgr_test.cpp +++ b/test/unittest/app_spawn_standard_test/app_spawn_appmgr_test.cpp @@ -124,7 +124,7 @@ HWTEST_F(AppSpawnAppMgrTest, App_Spawn_AppSpawnedProcess_001, TestSize.Level0) int result[resultCount] = {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0}; for (size_t i = 0; i < processNameCount; i++) { for (size_t j = 0; j < pidCount; j++) { - AppSpawnedProcess *app = AddSpawnedProcess(pidInput[j], processNameInput[i], 0, false); + AppSpawnedProcess *app = AddSpawnedProcess(pidInput[j], processNameInput[i], false); EXPECT_EQ(app != nullptr, result[i * pidCount + j]); } } @@ -167,7 +167,7 @@ HWTEST_F(AppSpawnAppMgrTest, App_Spawn_AppSpawnedProcess_002, TestSize.Level0) int result[resultCount] = {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0}; for (size_t i = 0; i < processNameCount; i++) { for (size_t j = 0; j < pidCount; j++) { - AppSpawnedProcess *app = AddSpawnedProcess(pidInput[j], processNameInput[i], 0, false); + AppSpawnedProcess *app = AddSpawnedProcess(pidInput[j], processNameInput[i], false); EXPECT_EQ(app != nullptr, result[i * pidCount + j]); } } @@ -205,7 +205,7 @@ HWTEST_F(AppSpawnAppMgrTest, App_Spawn_AppSpawnedProcess_003, TestSize.Level0) // GetSpawnedProcessByName size_t processNameCount = ARRAY_LENGTH(processNameInput); for (size_t i = 0; i < processNameCount; i++) { - AppSpawnedProcess *app = AddSpawnedProcess(1000, processNameInput[i], 0, false); // 10000 + AppSpawnedProcess *app = AddSpawnedProcess(1000, processNameInput[i], false); // 10000 EXPECT_EQ(app != nullptr, 1); } for (size_t i = 0; i < processNameCount; i++) { @@ -492,7 +492,7 @@ HWTEST_F(AppSpawnAppMgrTest, App_Spawn_AppSpawnMsgNode_005, TestSize.Level0) EXPECT_EQ(memcmp(buffer.data() + sizeof(AppSpawnMsg), outMsg->buffer, msgLen - sizeof(AppSpawnMsg)), 0); EXPECT_EQ(0, reminder); - AppSpawnedProcess *app = AddSpawnedProcess(9999999, "aaaa", 0, false); // 9999999 test + AppSpawnedProcess *app = AddSpawnedProcess(9999999, "aaaa", false); // 9999999 test EXPECT_EQ(app != nullptr, 1); TerminateSpawnedProcess(app); AppSpawnExtData extData; @@ -540,7 +540,7 @@ HWTEST_F(AppSpawnAppMgrTest, App_Spawn_AppSpawnMsgNode_006, TestSize.Level0) EXPECT_EQ(memcmp(buffer.data() + sizeof(AppSpawnMsg), outMsg->buffer, msgLen - sizeof(AppSpawnMsg)), 0); EXPECT_EQ(0, reminder); - AppSpawnedProcess *app = AddSpawnedProcess(9999999, "aaaa", 0, false); // 9999999 test + AppSpawnedProcess *app = AddSpawnedProcess(9999999, "aaaa", false); // 9999999 test EXPECT_EQ(app != nullptr, 1); ret = DecodeAppSpawnMsg(outMsg); diff --git a/test/unittest/app_spawn_standard_test/app_spawn_module_interface_test.cpp b/test/unittest/app_spawn_standard_test/app_spawn_module_interface_test.cpp index 640399f3..4276c37e 100644 --- a/test/unittest/app_spawn_standard_test/app_spawn_module_interface_test.cpp +++ b/test/unittest/app_spawn_standard_test/app_spawn_module_interface_test.cpp @@ -183,7 +183,7 @@ HWTEST_F(AppSpawnModuleInterfaceTest, App_Spawn_Process_Hook_001, TestSize.Level { AppSpawnMgr *mgr = CreateAppSpawnMgr(MODE_FOR_NWEB_SPAWN); EXPECT_EQ(mgr != nullptr, 1); - AppSpawnedProcess *app = AddSpawnedProcess(1000, "test-001", 0, false); + AppSpawnedProcess *app = AddSpawnedProcess(1000, "test-001", false); EXPECT_EQ(app != nullptr, 1); int ret = 0; -- Gitee