!5270 CreateBundleDataDir接口UID校验修改

Merge pull request !5270 from 赵淦/master
This commit is contained in:
openharmony_ci 2024-01-13 15:26:13 +00:00 committed by Gitee
commit 10aa2976b8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 1 deletions

View File

@ -6137,6 +6137,7 @@ ErrCode BundleDataMgr::CreateBundleDataDir(int32_t userId) const
createDirParam.apl = info.GetAppPrivilegeLevel();
createDirParam.isPreInstallApp = info.GetIsPreInstallApp();
createDirParam.debug = info.GetBaseApplicationInfo().debug;
createDirParam.createDirFlag = CreateDirFlag::CREATE_DIR_UNLOCKED;
createDirParams.emplace_back(createDirParam);
}
auto res = InstalldClient::GetInstance()->CreateBundleDataDirWithVector(createDirParams);

View File

@ -3310,7 +3310,7 @@ ErrCode BundleMgrHostImpl::SetAdditionalInfo(const std::string &bundleName, cons
ErrCode BundleMgrHostImpl::CreateBundleDataDir(int32_t userId)
{
if (!BundlePermissionMgr::IsCallingUidValid(Constants::STORAGE_SERVICE_UID)) {
if (!BundlePermissionMgr::IsCallingUidValid(Constants::ROOT_UID)) {
APP_LOGE("IsCallingUidValid failed");
return ERR_BUNDLE_MANAGER_PERMISSION_DENIED;
}