diff --git a/frameworks/native/source/system_ability_status_change_stub.cpp b/frameworks/native/source/system_ability_status_change_stub.cpp index bcae29e51357ffb54d6b6b30e7c79dc7dedb5c57..1b579ce00d40f2a12e5b02ff88d0913441c2a3b3 100755 --- a/frameworks/native/source/system_ability_status_change_stub.cpp +++ b/frameworks/native/source/system_ability_status_change_stub.cpp @@ -20,10 +20,6 @@ #include "system_ability_definition.h" namespace OHOS { -namespace { -constexpr int32_t UID_ROOT = 0; -constexpr int32_t UID_SYSTEM = 1000; -} SystemAbilityStatusChangeStub::SystemAbilityStatusChangeStub() { memberFuncMap_[ON_ADD_SYSTEM_ABILITY] = @@ -36,10 +32,6 @@ int32_t SystemAbilityStatusChangeStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { HILOGI("code:%{public}u, flags:%{public}d", code, option.GetFlags()); - if (!CanRequest()) { - HILOGW("permission denied!"); - return ERR_PERMISSION_DENIED; - } if (!EnforceInterceToken(data)) { HILOGW("check interface token failed!"); return ERR_PERMISSION_DENIED; @@ -84,12 +76,6 @@ bool SystemAbilityStatusChangeStub::CheckInputSysAbilityId(int32_t systemAbility return (systemAbilityId >= FIRST_SYS_ABILITY_ID) && (systemAbilityId <= LAST_SYS_ABILITY_ID); } -bool SystemAbilityStatusChangeStub::CanRequest() -{ - auto callingUid = IPCSkeleton::GetCallingUid(); - return (callingUid == UID_ROOT) || (callingUid == UID_SYSTEM); -} - bool SystemAbilityStatusChangeStub::EnforceInterceToken(MessageParcel& data) { std::u16string interfaceToken = data.ReadInterfaceToken(); diff --git a/services/samgr/native/samgr_standard.cfg b/services/samgr/native/samgr_standard.cfg index 0b75d9041f7289d2250cd138211874c024d54de9..67e3650230501b6d48d1e7a8858d729f52fefa29 100755 --- a/services/samgr/native/samgr_standard.cfg +++ b/services/samgr/native/samgr_standard.cfg @@ -15,8 +15,9 @@ "name" : "samgr", "path" : ["/system/bin/samgr"], "critical" : [1, 1, 60], - "uid" : "system", - "gid" : ["system"], + "uid" : "samgr", + "gid" : ["samgr"], + "secon" : "u:r:samgr:s0", "start-mode" : "boot", "jobs" : { "on-start" : "services:samgr"