From 1c666dc9393211d5ec1ff1e330313e73b3e5d779 Mon Sep 17 00:00:00 2001 From: liuziwei Date: Tue, 24 Sep 2024 18:47:58 +0800 Subject: [PATCH] fix code Signed-off-by: liuziwei --- services/ipc/src/user_auth_service.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/ipc/src/user_auth_service.cpp b/services/ipc/src/user_auth_service.cpp index 571bc56cd..1b35ed84c 100644 --- a/services/ipc/src/user_auth_service.cpp +++ b/services/ipc/src/user_auth_service.cpp @@ -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; }