diff --git a/common/hal_sdk/useridm_interface.cpp b/common/hal_sdk/useridm_interface.cpp index c5e6fdb..d722ead 100644 --- a/common/hal_sdk/useridm_interface.cpp +++ b/common/hal_sdk/useridm_interface.cpp @@ -98,7 +98,7 @@ int32_t AddCredential(std::vector enrollToken, uint64_t &credentialId) GlobalUnLock(); return RESULT_BAD_COPY; } - int32_t ret = AddCredentialFunc(enrollTokenIn, (uint32_t)sizeof(ScheduleTokenHal), &credentialId); + int32_t ret = AddCredentialFunc(enrollTokenIn, static_cast(sizeof(ScheduleTokenHal)), &credentialId); GlobalUnLock(); return ret; } @@ -274,8 +274,8 @@ int32_t UpdateCredential(std::vector enrollToken, uint64_t &credentialI return RESULT_BAD_COPY; } CredentialInfoHal credentialInfoHal; - int32_t ret = - UpdateCredentialFunc(enrollTokenIn, (uint32_t)sizeof(ScheduleTokenHal), &credentialId, &credentialInfoHal); + int32_t ret = UpdateCredentialFunc(enrollTokenIn, static_cast(sizeof(ScheduleTokenHal)), + &credentialId, &credentialInfoHal); if (ret != RESULT_SUCCESS) { LOG_ERROR("update failed"); GlobalUnLock(); diff --git a/interfaces/innerkits/include/auth_info.h b/interfaces/innerkits/include/auth_info.h index d1d1aa9..2bf7ed2 100644 --- a/interfaces/innerkits/include/auth_info.h +++ b/interfaces/innerkits/include/auth_info.h @@ -31,7 +31,7 @@ public: private: std::string pkgName_; - int32_t callerUid_; + uint64_t callerUid_; }; } // namespace CoAuth } // namespace UserIAM diff --git a/services/src/coauth_manager.cpp b/services/src/coauth_manager.cpp index ac8af95..eb44cee 100644 --- a/services/src/coauth_manager.cpp +++ b/services/src/coauth_manager.cpp @@ -70,6 +70,7 @@ void CoAuthManager::CoAuthHandle(uint64_t scheduleId, AuthInfo &authInfo, sptr(); SetAuthAttributes(commandAttrs, scheduleInfo, authInfo); - executeRet |= executorCallback->OnBeginExecute(scheduleId, publicKey, commandAttrs); + int32_t ret = executorCallback->OnBeginExecute(scheduleId, publicKey, commandAttrs); + if (ret != SUCCESS) { + COAUTH_HILOGE(MODULE_SERVICE, "executor i = %{public}zu failed", i); + executeRet = ret; + } } } @@ -128,8 +133,8 @@ int32_t CoAuthManager::Cancel(uint64_t scheduleId) uint32_t authType = scheduleInfo.executors[i].authType; sptr executorCallback; COAUTH_HILOGD(MODULE_SERVICE, "get exeID = %{public}u", authType); - int32_t findRet = coAuthResMgrPtr_->FindExecutorCallback(authType, executorCallback); - if ((findRet != 0) || (executorCallback == nullptr)) { + int32_t onceRet = coAuthResMgrPtr_->FindExecutorCallback(authType, executorCallback); + if ((onceRet != 0) || (executorCallback == nullptr)) { COAUTH_HILOGE(MODULE_SERVICE, "executor callback not found."); continue; } @@ -137,7 +142,11 @@ int32_t CoAuthManager::Cancel(uint64_t scheduleId) commandAttrs->SetUint32Value(AUTH_SCHEDULE_MODE, scheduleInfo.scheduleMode); commandAttrs->SetUint64Value(AUTH_SUBTYPE, scheduleInfo.authSubType); commandAttrs->SetUint64Value(AUTH_TEMPLATE_ID, scheduleInfo.templateId); - executeRet |= executorCallback->OnEndExecute(scheduleId, commandAttrs); + onceRet = executorCallback->OnEndExecute(scheduleId, commandAttrs); + if (onceRet != SUCCESS) { + COAUTH_HILOGE(MODULE_SERVICE, "executor i = %{public}zu failed", i); + executeRet = onceRet; + } } if (executeRet != SUCCESS) { COAUTH_HILOGW(MODULE_SERVICE, "There are one or more failures when canceling."); @@ -178,11 +187,10 @@ void CoAuthManager::SetExecutorProp(ResAuthAttributes &conditions, sptr properties = std::make_shared(); conditions.Pack(buffer); properties->Unpack(buffer); - result = execallback->OnSetProperty(properties); + result = static_cast(execallback->OnSetProperty(properties)); if (result != SUCCESS) { COAUTH_HILOGE(MODULE_SERVICE, "set properties failure"); } - COAUTH_HILOGI(MODULE_SERVICE, "set properties successfull"); callback->OnResult(result, extraInfo); }