/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() 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()
|
/base/startup/appspawn/modules/sandbox/ |
H A D | sandbox_adapter.cpp | 58 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetSpawningMsgInfo(context, TLV_DAC_INFO); in MakeAtomicServiceDir() local 59 APPSPAWN_CHECK(dacInfo != NULL, return, "No dac info for %{public}s", context->bundleName); in MakeAtomicServiceDir() 61 ret = chown(path, dacInfo->uid, dacInfo->gid); in MakeAtomicServiceDir() 63 ret = chown(path, dacInfo->uid, DecodeGid("ddms")); in MakeAtomicServiceDir() 65 ret = chown(path, dacInfo->uid, DecodeGid("log")); in MakeAtomicServiceDir()
|
H A D | sandbox_manager.c | 575 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetAppProperty(property, TLV_DAC_INFO); in AppendPermissionGid() local 576 APPSPAWN_CHECK(dacInfo != NULL, return APPSPAWN_TLV_NONE, in AppendPermissionGid() 595 if ((permissionNode->section.gidCount + dacInfo->gidCount) > APP_MAX_GIDS) { in AppendPermissionGid() 597 GetProcessName(property), dacInfo->gidCount, permissionNode->section.gidCount); in AppendPermissionGid() 598 copyLen = APP_MAX_GIDS - dacInfo->gidCount; in AppendPermissionGid() 600 int ret = memcpy_s(&dacInfo->gidTable[dacInfo->gidCount], sizeof(gid_t) * copyLen, in AppendPermissionGid() 608 dacInfo->gidCount += copyLen; in AppendPermissionGid() 616 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetAppProperty(property, TLV_DAC_INFO); in AppendPackageNameGids() local 617 APPSPAWN_CHECK(dacInfo ! in AppendPackageNameGids() [all...] |
H A D | sandbox_utils.cpp | 413 AppSpawnMsgDacInfo *dacInfo = reinterpret_cast<AppSpawnMsgDacInfo *>(GetAppProperty(appProperty, TLV_DAC_INFO)); 414 APPSPAWN_CHECK(dacInfo != NULL, return, "No dac info in msg app property"); 416 ret = chown(path.c_str(), dacInfo->uid, dacInfo->gid); 418 ret = chown(path.c_str(), dacInfo->uid, APP_DATABASE_DIR_GID); 420 ret = chown(path.c_str(), dacInfo->uid, APP_LOG_DIR_GID); 482 AppSpawnMsgDacInfo *dacInfo = reinterpret_cast<AppSpawnMsgDacInfo *>(GetAppProperty(appProperty, TLV_DAC_INFO)); in ConvertToRealPath() local 483 if (info == nullptr || dacInfo == nullptr) { in ConvertToRealPath() 499 path = replace_all(path, g_userId, std::to_string(dacInfo->uid / UID_BASE)); in ConvertToRealPath() 563 AppSpawnMsgDacInfo *dacInfo in GetSbxPathByConfig() local 643 AppSpawnMsgDacInfo *dacInfo = reinterpret_cast<AppSpawnMsgDacInfo *>(GetAppProperty(appProperty, TLV_DAC_INFO)); DoDlpAppMountStrategy() local 736 AppSpawnMsgDacInfo *dacInfo = reinterpret_cast<AppSpawnMsgDacInfo *>(GetAppProperty(appProperty, TLV_DAC_INFO)); GetSandboxOptions() local 844 AppSpawnMsgDacInfo *dacInfo = reinterpret_cast<AppSpawnMsgDacInfo *>(GetAppProperty(appProperty, TLV_DAC_INFO)); DoAddGid() local 1614 AppSpawnMsgDacInfo *dacInfo = reinterpret_cast<AppSpawnMsgDacInfo *>(GetAppProperty(appProperty, TLV_DAC_INFO)); SetAppSandboxProperty() local [all...] |
/base/startup/appspawn/modules/common/ |
H A D | appspawn_common.c | 101 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetAppProperty(property, TLV_DAC_INFO); in SetKeepCapabilities() local 102 APPSPAWN_CHECK(dacInfo != NULL, return APPSPAWN_TLV_NONE, in SetKeepCapabilities() 106 if (dacInfo->uid != 0) { in SetKeepCapabilities() 229 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetAppProperty(property, TLV_DAC_INFO); in SetUidGid() local 230 APPSPAWN_CHECK(dacInfo != NULL, return APPSPAWN_TLV_NONE, in SetUidGid() 234 int ret = setgroups(dacInfo->gidCount, (const gid_t *)(&dacInfo->gidTable[0])); in SetUidGid() 236 "setgroups failed: %{public}d, gids.size=%{public}u", errno, dacInfo->gidCount); in SetUidGid() 240 gid_t gid = dacInfo->gid / UID_BASE; in SetUidGid() 242 APPSPAWN_LOGE("SetUidGid invalid uid for nwebspawn %{public}d", dacInfo in SetUidGid() [all...] |
/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 APPSPAWN_CHECK_ONLY_EXPER(strcpy_s(dacInfo.userName, sizeof(dacInfo.userName), "test-app-name") == 0, in AddDacInfo() 465 return AppSpawnReqMsgSetAppDacInfo(reqHandle, &dacInfo); in AddDacInfo() 708 AppDacInfo dacInfo in AddBaseTlv() local [all...] |
/base/startup/appspawn/test/unittest/app_spawn_client_test/ |
H A D | app_spawn_client_test.cpp | 748 AppDacInfo dacInfo = {}; in HWTEST_F() local 749 dacInfo.uid = 20010029; // 20010029 test uid in HWTEST_F() 750 dacInfo.gid = 20010029; // 20010029 test gid in HWTEST_F() 751 dacInfo.gidCount = 2; // 2 count in HWTEST_F() 752 dacInfo.gidTable[0] = 20010029; // 20010029 test gid in HWTEST_F() 753 dacInfo.gidTable[1] = 20010030; // 20010030 test gid in HWTEST_F() 754 ret = AppSpawnReqMsgSetAppDacInfo(reqHandle, &dacInfo); in HWTEST_F() 771 AppDacInfo dacInfo = {}; in HWTEST_F() local 772 dacInfo.uid = 20010029; // 20010029 test uid in HWTEST_F() 773 dacInfo in HWTEST_F() 808 AppDacInfo dacInfo = {}; HWTEST_F() local [all...] |
H A D | app_spawn_interface_test.cpp | 234 AppDacInfo dacInfo; in HWTEST_F() local 235 dacInfo.uid = 20010029; // 20010029 test data in HWTEST_F() 236 dacInfo.gid = 20010029; // 20010029 test data in HWTEST_F() 237 dacInfo.gidCount = 2; // 2 count in HWTEST_F() 238 dacInfo.gidTable[0] = 20010029; // 20010029 test data in HWTEST_F() 239 dacInfo.gidTable[1] = 20010029 + 1; // 20010029 test data in HWTEST_F() 245 const AppDacInfo *dacInfo1[] = {&dacInfo, nullptr}; in HWTEST_F()
|
/base/startup/appspawn/standard/ |
H A D | appspawn_msgmgr.c | 381 AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetAppSpawnMsgInfo(message, TLV_DAC_INFO); in DumpAppSpawnMsg() local 382 if (dacInfo != NULL) { in DumpAppSpawnMsg() 384 dacInfo->uid, dacInfo->gid, dacInfo->gidCount); in DumpAppSpawnMsg() 385 for (uint32_t i = 0; i < dacInfo->gidCount; i++) { in DumpAppSpawnMsg() 386 APPSPAPWN_DUMP("gid group[%{public}d]: %{public}d", i, dacInfo->gidTable[i]); in DumpAppSpawnMsg()
|
H A D | appspawn_service.c | 1018 AppSpawnMsgDacInfo *dacInfo = GetAppProperty(property, TLV_DAC_INFO); in ProcessChildResponse() local 1019 appInfo->uid = dacInfo != NULL ? dacInfo->uid : 0; in ProcessChildResponse()
|
/base/startup/appspawn/interfaces/innerkits/include/ |
H A D | appspawn.h | 195 * @param dacInfo dac info from AppDacInfo 198 int AppSpawnReqMsgSetAppDacInfo(AppSpawnReqMsgHandle reqHandle, const AppDacInfo *dacInfo);
|
/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()
|
/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()
|