Lines Matching refs:tokenInfo
413 static uint32_t CheckProcessInfo(NativeTokenInfoParams *tokenInfo, int32_t *aplRet) in CheckProcessInfo() argument
415 if ((tokenInfo->processName == NULL) || strlen(tokenInfo->processName) > MAX_PROCESS_NAME_LEN || in CheckProcessInfo()
416 strlen(tokenInfo->processName) == 0) { in CheckProcessInfo()
420 …uint32_t retDcap = CheckStrArray(tokenInfo->dcaps, tokenInfo->dcapsNum, MAX_DCAPS_NUM, MAX_DCAP_LE… in CheckProcessInfo()
425 …uint32_t retPerm = CheckStrArray(tokenInfo->perms, tokenInfo->permsNum, MAX_PERM_NUM, MAX_PERM_LEN… in CheckProcessInfo()
431 … uint32_t retAcl = CheckStrArray(tokenInfo->acls, tokenInfo->aclsNum, MAX_PERM_NUM, MAX_PERM_LEN); in CheckProcessInfo()
437 if (tokenInfo->aclsNum > tokenInfo->permsNum) { in CheckProcessInfo()
441 int32_t apl = GetAplLevel(tokenInfo->aplStr); in CheckProcessInfo()
463 static uint32_t AddNewTokenToListAndFile(const NativeTokenInfoParams *tokenInfo, in AddNewTokenToListAndFile() argument
469 id = CreateNativeTokenId(tokenInfo->processName); in AddNewTokenToListAndFile()
481 if (strcpy_s(tokenNode->processName, MAX_PROCESS_NAME_LEN + 1, tokenInfo->processName) != EOK) { in AddNewTokenToListAndFile()
486 tokenNode->dcapsNum = tokenInfo->dcapsNum; in AddNewTokenToListAndFile()
487 tokenNode->permsNum = tokenInfo->permsNum; in AddNewTokenToListAndFile()
488 tokenNode->aclsNum = tokenInfo->aclsNum; in AddNewTokenToListAndFile()
490 if (CreateStrArray(tokenInfo->dcapsNum, tokenInfo->dcaps, tokenNode->dcaps) != ATRET_SUCCESS) { in AddNewTokenToListAndFile()
494 if (CreateStrArray(tokenInfo->permsNum, tokenInfo->perms, tokenNode->perms) != ATRET_SUCCESS) { in AddNewTokenToListAndFile()
495 FreeStrArray(tokenNode->dcaps, tokenInfo->dcapsNum - 1); in AddNewTokenToListAndFile()
499 if (CreateStrArray(tokenInfo->aclsNum, tokenInfo->acls, tokenNode->acls) != ATRET_SUCCESS) { in AddNewTokenToListAndFile()
500 FreeStrArray(tokenNode->dcaps, tokenInfo->dcapsNum - 1); in AddNewTokenToListAndFile()
501 FreeStrArray(tokenNode->perms, tokenInfo->permsNum - 1); in AddNewTokenToListAndFile()
568 const NativeTokenInfoParams *tokenInfo) in UpdateTokenInfoInList() argument
570 tokenNode->apl = GetAplLevel(tokenInfo->aplStr); in UpdateTokenInfoInList()
573 tokenInfo->dcaps, tokenInfo->dcapsNum); in UpdateTokenInfoInList()
578 tokenInfo->perms, tokenInfo->permsNum); in UpdateTokenInfoInList()
583 tokenInfo->acls, tokenInfo->aclsNum); in UpdateTokenInfoInList()
626 uint64_t GetAccessTokenId(NativeTokenInfoParams *tokenInfo) in GetAccessTokenId() argument
636 uint32_t ret = CheckProcessInfo(tokenInfo, &apl); in GetAccessTokenId()
643 if (strcmp(tokenNode->processName, tokenInfo->processName) == 0) { in GetAccessTokenId()
651 ret = AddNewTokenToListAndFile(tokenInfo, apl, &tokenId); in GetAccessTokenId()
653 … int32_t needTokenUpdate = CompareTokenInfo(tokenNode, tokenInfo->dcaps, tokenInfo->dcapsNum, apl); in GetAccessTokenId()
654 int32_t needPermUpdate = ComparePermsInfo(tokenNode, tokenInfo->perms, tokenInfo->permsNum); in GetAccessTokenId()
656 ret = UpdateTokenInfoInList(tokenNode, tokenInfo); in GetAccessTokenId()