Chris PeBenito ab58ad
#DESC hald - server for device info
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Author:  Russell Coker <rcoker@redhat.com>
Chris PeBenito ab58ad
# X-Debian-Packages: 
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#################################
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Rules for the hald_t domain.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# hald_exec_t is the type of the hald executable.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
daemon_domain(hald, `, fs_domain, nscd_client_domain')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
can_exec_any(hald_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow hald_t { etc_t etc_runtime_t }:file { getattr read };
Chris PeBenito ab58ad
allow hald_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito ab58ad
allow hald_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`dbusd.te', `
Chris PeBenito ab58ad
allow hald_t system_dbusd_t:dbus { acquire_svc send_msg };
Chris PeBenito ab58ad
dbusd_client(system, hald)
Chris PeBenito ab58ad
allow hald_t self:dbus send_msg;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow hald_t self:file { getattr read };
Chris PeBenito ab58ad
allow hald_t proc_t:file rw_file_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow hald_t { bin_t sbin_t }:dir search;
Chris PeBenito ab58ad
allow hald_t self:fifo_file rw_file_perms;
Chris PeBenito ab58ad
allow hald_t usr_t:file { getattr read };
Chris PeBenito ab58ad
allow hald_t bin_t:file getattr;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# For backwards compatibility with older kernels
Chris PeBenito ab58ad
allow hald_t self:netlink_socket create_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow hald_t self:netlink_kobject_uevent_socket create_socket_perms;
Chris PeBenito ab58ad
allow hald_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito ab58ad
allow hald_t self:capability { net_admin sys_admin dac_override dac_read_search mknod sys_rawio };
Chris PeBenito ab58ad
can_network_server(hald_t)
Chris PeBenito ab58ad
can_ypbind(hald_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow hald_t device_t:lnk_file read;
Chris PeBenito ab58ad
allow hald_t { fixed_disk_device_t removable_device_t }:blk_file { getattr read ioctl };
Chris PeBenito ab58ad
allow hald_t removable_device_t:blk_file write;
Chris PeBenito ab58ad
allow hald_t event_device_t:chr_file { getattr read ioctl };
Chris PeBenito ab58ad
allow hald_t printer_device_t:chr_file rw_file_perms;
Chris PeBenito ab58ad
allow hald_t urandom_device_t:chr_file read;
Chris PeBenito ab58ad
allow hald_t mouse_device_t:chr_file r_file_perms;
Chris PeBenito ab58ad
allow hald_t device_type:chr_file getattr;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
can_getsecurity(hald_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`updfstab.te', `
Chris PeBenito ab58ad
domain_auto_trans(hald_t, updfstab_exec_t, updfstab_t)
Chris PeBenito ab58ad
allow updfstab_t hald_t:dbus send_msg;
Chris PeBenito ab58ad
allow hald_t updfstab_t:dbus send_msg;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
ifdef(`udev.te', `
Chris PeBenito ab58ad
domain_auto_trans(hald_t, udev_exec_t, udev_t)
Chris PeBenito ab58ad
allow udev_t hald_t:unix_dgram_socket sendto;
Chris PeBenito ab58ad
allow hald_t udev_tbl_t:file { getattr read };
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`hotplug.te', `
Chris PeBenito ab58ad
r_dir_file(hald_t, hotplug_etc_t)
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
allow hald_t fs_type:dir { search getattr };
Chris PeBenito ab58ad
allow hald_t usbfs_t:dir r_dir_perms;
Chris PeBenito ab58ad
allow hald_t { usbdevfs_t usbfs_t }:file rw_file_perms;
Chris PeBenito ab58ad
allow hald_t bin_t:lnk_file read;
Chris PeBenito ab58ad
r_dir_file(hald_t, { selinux_config_t default_context_t } )
Chris PeBenito ab58ad
allow hald_t initrc_t:dbus send_msg;
Chris PeBenito ab58ad
allow initrc_t hald_t:dbus send_msg;
Chris PeBenito ab58ad
allow hald_t etc_runtime_t:file rw_file_perms;
Chris PeBenito ab58ad
allow hald_t var_lib_t:dir search;
Chris PeBenito ab58ad
allow hald_t device_t:dir create_dir_perms;
Chris PeBenito ab58ad
allow hald_t device_t:chr_file create_file_perms;
Chris PeBenito ab58ad
tmp_domain(hald)
Chris PeBenito ab58ad
allow hald_t mnt_t:dir search;
Chris PeBenito ab58ad
r_dir_file(hald_t, proc_net_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# For /usr/libexec/hald-addon-acpi - writes to /var/run/acpid.socket
Chris PeBenito ab58ad
ifdef(`apmd.te', `
Chris PeBenito ab58ad
allow hald_t apmd_var_run_t:sock_file write;
Chris PeBenito ab58ad
allow hald_t apmd_t:unix_stream_socket connectto;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# For /usr/libexec/hald-probe-smbios
Chris PeBenito ab58ad
domain_auto_trans(hald_t, dmidecode_exec_t, dmidecode_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# ??
Chris PeBenito ab58ad
ifdef(`lvm.te', `
Chris PeBenito ab58ad
allow hald_t lvm_control_t:chr_file r_file_perms;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
ifdef(`targeted_policy', `
Chris PeBenito ab58ad
allow unconfined_t hald_t:dbus send_msg;
Chris PeBenito ab58ad
allow hald_t unconfined_t:dbus send_msg;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
ifdef(`mount.te', `
Chris PeBenito ab58ad
domain_auto_trans(hald_t, mount_exec_t, mount_t)
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
r_dir_file(hald_t, hwdata_t)