/ohos5.0/base/startup/appspawn/test/moduletest/ |
H A D | appspawn_client_test.cpp | 45 AppDacInfo dacInfo = {}; in CreateMsg() local 46 dacInfo.uid = 20010029; // 20010029 test data in CreateMsg() 47 dacInfo.gid = 20010029; // 20010029 test data in CreateMsg() 48 dacInfo.gidCount = 2; // 2 count in CreateMsg() 49 dacInfo.gidTable[0] = 20010029; // 20010029 test data in CreateMsg() 50 dacInfo.gidTable[1] = 20010029 + 1; // 20010029 test data in CreateMsg() 51 (void)strcpy_s(dacInfo.userName, sizeof(dacInfo.userName), "test-app-name"); in CreateMsg() 52 ret = AppSpawnReqMsgSetAppDacInfo(reqHandle, &dacInfo); in CreateMsg()
|
H A D | appspawn_test_cmder.cpp | 248 AppDacInfo dacInfo{}; in AddExtTlv() local 249 dacInfo.uid = 101; // 101 test data in AddExtTlv() 250 dacInfo.gid = 101; // 101 test data in AddExtTlv() 251 dacInfo.gidTable[0] = 101; // 101 test data in AddExtTlv() 252 dacInfo.gidCount = 1; in AddExtTlv() 253 (void)strcpy_s(dacInfo.userName, sizeof(dacInfo.userName), processName_.c_str()); in AddExtTlv() 255 "app-dac-info", reinterpret_cast<uint8_t *>(&dacInfo), sizeof(dacInfo)); in AddExtTlv()
|
/ohos5.0/base/startup/appspawn/modules/common/ |
H A D | appspawn_common.c | 103 APPSPAWN_CHECK(dacInfo != NULL, return APPSPAWN_TLV_NONE, in SetKeepCapabilities() 107 if (dacInfo->uid != 0) { in SetKeepCapabilities() 237 APPSPAWN_CHECK(dacInfo != NULL, return APPSPAWN_TLV_NONE, in SetUidGid() 241 int ret = setgroups(dacInfo->gidCount, (const gid_t *)(&dacInfo->gidTable[0])); in SetUidGid() 243 "setgroups failed: %{public}d, gids.size=%{public}u", errno, dacInfo->gidCount); in SetUidGid() 247 gid_t gid = dacInfo->gid / UID_BASE; in SetUidGid() 252 ret = setresgid(dacInfo->gid, dacInfo->gid, dacInfo->gid); in SetUidGid() 254 ret = setresgid(dacInfo->gid, dacInfo->gid, dacInfo->gid); in SetUidGid() 257 "setgid(%{public}u) failed: %{public}d", dacInfo->gid, errno); in SetUidGid() 265 ret = setresuid(dacInfo->uid, dacInfo->uid, dacInfo->uid); in SetUidGid() [all …]
|
/ohos5.0/base/startup/appspawn/test/unittest/ |
H A D | app_spawn_test_helper.cpp | 457 AppDacInfo dacInfo = {}; in AddDacInfo() local 458 dacInfo.uid = defaultTestUid_; in AddDacInfo() 459 dacInfo.gid = defaultTestGid_; in AddDacInfo() 460 dacInfo.gidCount = 2; // 2 count in AddDacInfo() 461 dacInfo.gidTable[0] = defaultTestGidGroup_; in AddDacInfo() 462 dacInfo.gidTable[1] = defaultTestGidGroup_ + 1; in AddDacInfo() 463 (void)strcpy_s(dacInfo.userName, sizeof(dacInfo.userName), "test-app-name"); in AddDacInfo() 705 AppDacInfo dacInfo = {}; in AddBaseTlv() local 706 dacInfo.uid = 20010029; // 20010029 test uid in AddBaseTlv() 707 dacInfo.gid = 20010029; // 20010029 test gid in AddBaseTlv() [all …]
|
/ohos5.0/base/startup/appspawn/test/unittest/app_spawn_client_test/ |
H A D | app_spawn_client_test.cpp | 748 AppDacInfo dacInfo = {}; variable 749 dacInfo.uid = 20010029; // 20010029 test uid 750 dacInfo.gid = 20010029; // 20010029 test gid 751 dacInfo.gidCount = 2; // 2 count 771 AppDacInfo dacInfo = {}; variable 772 dacInfo.uid = 20010029; // 20010029 test uid 773 dacInfo.gid = 20010029; // 20010029 test gid 774 dacInfo.gidCount = 2; // 2 count 808 AppDacInfo dacInfo = {}; variable 811 dacInfo.gidCount = 2; // 2 count [all …]
|
H A D | app_spawn_interface_test.cpp | 234 AppDacInfo dacInfo; variable 235 dacInfo.uid = 20010029; // 20010029 test data 236 dacInfo.gid = 20010029; // 20010029 test data 237 dacInfo.gidCount = 2; // 2 count 238 dacInfo.gidTable[0] = 20010029; // 20010029 test data 239 dacInfo.gidTable[1] = 20010029 + 1; // 20010029 test data 245 const AppDacInfo *dacInfo1[] = {&dacInfo, nullptr};
|
/ohos5.0/base/startup/appspawn/modules/sandbox/ |
H A D | sandbox_utils.cpp | 423 ret = chown(path.c_str(), dacInfo->uid, dacInfo->gid); in MakeAtomicServiceDir() 490 if (info == nullptr || dacInfo == nullptr) { in ConvertToRealPath() 571 if (dacInfo == nullptr) { in GetSbxPathByConfig() 651 if (dacInfo == nullptr) { in DoDlpAppMountStrategy() 666 fd, dacInfo->uid, dacInfo->gid); in DoDlpAppMountStrategy() 748 if (dacInfo == nullptr) { in GetSandboxOptions() 756 options += std::to_string(dacInfo->uid / userIdBase); in GetSandboxOptions() 858 if (dacInfo == nullptr) { in DoAddGid() 865 if (dacInfo->gidCount < APP_MAX_GIDS) { in DoAddGid() 868 dacInfo->gidTable[dacInfo->gidCount++] = gids[i].get<uint32_t>(); in DoAddGid() [all …]
|
H A D | sandbox_manager.c | 541 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetAppProperty(property, TLV_DAC_INFO); in AppendPermissionGid() local 542 APPSPAWN_CHECK(dacInfo != NULL, return APPSPAWN_TLV_NONE, in AppendPermissionGid() 561 if ((permissionNode->section.gidCount + dacInfo->gidCount) > APP_MAX_GIDS) { in AppendPermissionGid() 563 GetProcessName(property), dacInfo->gidCount, permissionNode->section.gidCount); in AppendPermissionGid() 564 copyLen = APP_MAX_GIDS - dacInfo->gidCount; in AppendPermissionGid() 566 int ret = memcpy_s(&dacInfo->gidTable[dacInfo->gidCount], sizeof(gid_t) * copyLen, in AppendPermissionGid() 574 dacInfo->gidCount += copyLen; in AppendPermissionGid()
|
H A D | appspawn_sandbox.c | 376 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetSpawningMsgInfo(context, TLV_DAC_INFO); in GetRealSrcPath() local 378 if (accountId == NULL || dacInfo == NULL) { in GetRealSrcPath() 392 int ret = chown(originPath, dacInfo->uid, dacInfo->gid); in GetRealSrcPath()
|
/ohos5.0/base/startup/appspawn/standard/ |
H A D | appspawn_msgmgr.c | 383 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetAppSpawnMsgInfo(message, TLV_DAC_INFO); in DumpAppSpawnMsg() local 384 if (dacInfo != NULL) { in DumpAppSpawnMsg() 386 dacInfo->uid, dacInfo->gid, dacInfo->gidCount); in DumpAppSpawnMsg() 387 for (uint32_t i = 0; i < dacInfo->gidCount; i++) { in DumpAppSpawnMsg() 388 APPSPAPWN_DUMP("gid group[%{public}d]: %{public}d", i, dacInfo->gidTable[i]); in DumpAppSpawnMsg()
|
H A D | appspawn_service.c | 1008 AppSpawnMsgDacInfo *dacInfo = GetAppProperty(property, TLV_DAC_INFO); in ProcessChildResponse() local 1009 appInfo->uid = dacInfo != NULL ? dacInfo->uid : 0; in ProcessChildResponse()
|
/ohos5.0/base/startup/appspawn/interfaces/innerkits/include/ |
H A D | appspawn.h | 198 int AppSpawnReqMsgSetAppDacInfo(AppSpawnReqMsgHandle reqHandle, const AppDacInfo *dacInfo);
|
/ohos5.0/base/startup/appspawn/test/fuzztest/appspawnclient_fuzzer/ |
H A D | appspawnclient_fuzzer.cpp | 163 AppDacInfo dacInfo = {}; in FuzzAppSpawnReqMsgSetAppDacInfo() local 164 (void)AppSpawnReqMsgSetAppDacInfo(reqHandle, &dacInfo); in FuzzAppSpawnReqMsgSetAppDacInfo()
|
/ohos5.0/base/startup/appspawn/interfaces/innerkits/client/ |
H A D | appspawn_msg.c | 363 int AppSpawnReqMsgSetAppDacInfo(AppSpawnReqMsgHandle reqHandle, const AppDacInfo *dacInfo) in AppSpawnReqMsgSetAppDacInfo() argument 367 APPSPAWN_CHECK(dacInfo != NULL, return APPSPAWN_ARG_INVALID, "Invalid dacInfo "); in AppSpawnReqMsgSetAppDacInfo() 370 (void)memcpy_s(&tmpDacInfo, sizeof(tmpDacInfo), dacInfo, sizeof(tmpDacInfo)); in AppSpawnReqMsgSetAppDacInfo()
|