# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. init_daemon_domain(cupsd); allow cupsd data_file:dir { search }; allow cupsd system_bin_file:dir { search getattr read open}; allow cupsd system_bin_file:file { entrypoint execute execute_no_trans getattr map read open }; allow cupsd toybox_exec:file { entrypoint execute execute_no_trans getattr map read open }; allow cupsd cupsd_exec:file { entrypoint execute map read }; allow cupsd sh_exec:file { execute execute_no_trans map open read }; allow cupsd cupsd:tcp_socket { accept bind connect create getattr listen read setopt getopt write shutdown }; allow cupsd data_local:dir { search }; allow cupsd data_local_tmp:dir { getattr }; allow cupsd dev_unix_socket:dir { search }; allow cupsd musl_param:file { map open read }; allow cupsd debug_param:file { map open read }; allow cupsd netsysnative:unix_stream_socket { connectto }; allow cupsd node:tcp_socket { node_bind }; allow cupsd node:udp_socket { node_bind }; allow cupsd port:tcp_socket { name_bind name_connect }; allow cupsd proc_file:file { open read }; allow cupsd sysfs_devices_system_cpu:file { getattr open read }; allow cupsd cupsd:udp_socket { create setopt read write bind getattr getopt }; allow cupsd data_service_el1_file:dir { write search }; allow cupsd data_service_el1_public_print_service_file:dir { open read add_name remove_name search write create getattr setattr }; allow cupsd data_service_el1_public_print_service_file:file { append open create getattr read rename setattr write open map unlink execute execute_no_trans ioctl lock }; allowxperm cupsd data_service_el1_public_print_service_file:file ioctl { 0x5413 }; allow cupsd data_service_file:dir { search }; allow cupsd proc_cpuinfo_file:file { getattr open read }; allow cupsd dev_console_file:chr_file { read write }; neverallow cupsd { data_file_attr -data_service_el1_public_print_service_file -data_app_el1_file }:file {execute execute_no_trans entrypoint}; allow cupsd data_service_el1_public_print_service_file:lnk_file { read }; allow cupsd sa_usb_service:samgr_class { get }; allow cupsd usb_service:binder { call }; allow cupsd data_app_el1_file:file { execute execute_no_trans }; allow cupsd tty_device:chr_file { getattr ioctl open read write }; allowxperm cupsd tty_device:chr_file ioctl { 0x5413 }; allow cupsd print_service:dir { search getattr }; allow cupsd print_service:file { open read }; allow cupsd system_fonts_file:dir { open read search }; allow cupsd system_fonts_file:file { getattr open read }; allow cupsd system_fonts_file:lnk_file { read }; allow cupsd system_bin_file:lnk_file { read }; allow cupsd system_bin_uni_print_driver_file:dir { search }; allow cupsd system_bin_uni_print_driver_file:file { execute execute_no_trans getattr map read open };