AServiceManager_checkServiceAccess

Function AServiceManager_checkServiceAccess 

Source
pub unsafe extern "C" fn AServiceManager_checkServiceAccess(
    caller_sid: *const c_char,
    caller_debug_pid: pid_t,
    caller_uid: uid_t,
    instance: *const c_char,
    permission: AServiceManager_PermissionType,
) -> bool
Expand description

Check if this ‘callerSid’ has access for the ‘permission’ for a given service ‘name’.

This is useful when a process will be making calls to servicemanager on behalf of another process (callerCtx). The direct caller of this function also needs to have the permissions it is checking on behalf of the other process.

\param caller_sid - UTF-8 encoded string. SELinux context of the process that is being checked. \param caller_debug_pid - PID of the process that is being checked. This can only be used in logging for debugging because PIDs are reused. Servicemanager uses it for logging denials. \param caller_uid - UID of the process that is being checked. Servicemanager only uses this for logging denials for better debugging. \param instance - UTF-8 encoded string. Instance name of the service that the caller wants to interact with. \param permission - The servicemanager SELinux permission that the process is interested in for the service.

\return True if the process with caller_sid has the SELinux permission for the given service instance. False if it does not have permission or some error occurred.