!1047 不允许应用在后台发起认证,补充应用是否为系统应用检查

Merge pull request !1047 from liuziwei/master
This commit is contained in:
openharmony_ci 2024-09-25 09:39:38 +00:00 committed by Gitee
commit 34fcc7dc9d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -820,7 +820,8 @@ int32_t UserAuthService::CheckAuthPermissionAndParam(const std::string &callerNa
IAM_LOGE("CheckPermission failed");
return CHECK_PERMISSION_FAILED;
}
if (callerType == Security::AccessToken::TOKEN_HAP && (!IpcCommon::CheckForegroundApplication(callerName))) {
if (callerType == Security::AccessToken::TOKEN_HAP && (!IpcCommon::CheckPermission(*this, IS_SYSTEM_APP)) &&
(!IpcCommon::CheckForegroundApplication(callerName))) {
IAM_LOGE("failed to check foreground application");
return CHECK_PERMISSION_FAILED;
}