2005-06-02 14:31:31 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-08 20:23:12 +00:00
|
|
|
# Support macros for sets of object classes and permissions
|
2005-06-02 14:31:31 +00:00
|
|
|
#
|
2005-06-08 20:23:12 +00:00
|
|
|
# This file should only have object class and permission set macros - they
|
|
|
|
# can only reference object classes and/or permissions.
|
2005-06-02 14:31:31 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# All directory and file classes
|
|
|
|
#
|
|
|
|
define(`dir_file_class_set', `{ dir file lnk_file sock_file fifo_file chr_file blk_file }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# All non-directory file classes.
|
|
|
|
#
|
|
|
|
define(`file_class_set', `{ file lnk_file sock_file fifo_file chr_file blk_file }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Non-device file classes.
|
|
|
|
#
|
|
|
|
define(`notdevfile_class_set', `{ file lnk_file sock_file fifo_file }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Device file classes.
|
|
|
|
#
|
|
|
|
define(`devfile_class_set', `{ chr_file blk_file }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# All socket classes.
|
|
|
|
#
|
2015-05-21 17:38:09 +00:00
|
|
|
define(`socket_class_set', `{ tcp_socket udp_socket rawip_socket netlink_socket packet_socket unix_stream_socket unix_dgram_socket appletalk_socket netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_nflog_socket netlink_xfrm_socket netlink_selinux_socket netlink_audit_socket netlink_ip6fw_socket netlink_dnrt_socket netlink_kobject_uevent_socket tun_socket netlink_iscsi_socket netlink_fib_lookup_socket netlink_connector_socket netlink_netfilter_socket netlink_generic_socket netlink_scsitransport_socket netlink_rdma_socket netlink_crypto_socket }')
|
2005-06-02 14:31:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Datagram socket classes.
|
|
|
|
#
|
|
|
|
define(`dgram_socket_class_set', `{ udp_socket unix_dgram_socket }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Stream socket classes.
|
|
|
|
#
|
|
|
|
define(`stream_socket_class_set', `{ tcp_socket unix_stream_socket }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Unprivileged socket classes (exclude rawip, netlink, packet).
|
|
|
|
#
|
|
|
|
define(`unpriv_socket_class_set', `{ tcp_socket udp_socket unix_stream_socket unix_dgram_socket }')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Macros for sets of permissions
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions to mount and unmount file systems.
|
|
|
|
#
|
|
|
|
define(`mount_fs_perms', `{ mount remount unmount getattr }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for using sockets.
|
|
|
|
#
|
|
|
|
define(`rw_socket_perms', `{ ioctl read getattr write setattr append bind connect getopt setopt shutdown }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for creating and using sockets.
|
|
|
|
#
|
|
|
|
define(`create_socket_perms', `{ create rw_socket_perms }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for using stream sockets.
|
|
|
|
#
|
|
|
|
define(`rw_stream_socket_perms', `{ rw_socket_perms listen accept }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for creating and using stream sockets.
|
|
|
|
#
|
|
|
|
define(`create_stream_socket_perms', `{ create_socket_perms listen accept }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for creating and using sockets.
|
|
|
|
#
|
|
|
|
define(`connected_socket_perms', `{ create ioctl read getattr write setattr append bind getopt setopt shutdown }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for creating and using sockets.
|
|
|
|
#
|
|
|
|
define(`connected_stream_socket_perms', `{ connected_socket_perms listen accept }')
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for creating and using netlink sockets.
|
|
|
|
#
|
|
|
|
define(`create_netlink_socket_perms', `{ create_socket_perms nlmsg_read nlmsg_write }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for using netlink sockets for operations that modify state.
|
|
|
|
#
|
|
|
|
define(`rw_netlink_socket_perms', `{ create_socket_perms nlmsg_read nlmsg_write }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for using netlink sockets for operations that observe state.
|
|
|
|
#
|
|
|
|
define(`r_netlink_socket_perms', `{ create_socket_perms nlmsg_read }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for sending all signals.
|
|
|
|
#
|
|
|
|
define(`signal_perms', `{ sigchld sigkill sigstop signull signal }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for sending and receiving network packets.
|
|
|
|
#
|
|
|
|
define(`packet_perms', `{ tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Permissions for using System V IPC
|
|
|
|
#
|
|
|
|
define(`r_sem_perms', `{ associate getattr read unix_read }')
|
|
|
|
define(`rw_sem_perms', `{ associate getattr read write unix_read unix_write }')
|
|
|
|
define(`create_sem_perms', `{ associate getattr setattr create destroy read write unix_read unix_write }')
|
|
|
|
define(`r_msgq_perms', `{ associate getattr read unix_read }')
|
|
|
|
define(`rw_msgq_perms', `{ associate getattr read write enqueue unix_read unix_write }')
|
|
|
|
define(`create_msgq_perms', `{ associate getattr setattr create destroy read write enqueue unix_read unix_write }')
|
|
|
|
define(`r_shm_perms', `{ associate getattr read unix_read }')
|
|
|
|
define(`rw_shm_perms', `{ associate getattr read write lock unix_read unix_write }')
|
|
|
|
define(`create_shm_perms', `{ associate getattr setattr create destroy read write lock unix_read unix_write }')
|
2005-06-17 18:56:23 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-10-12 18:17:10 +00:00
|
|
|
# New permission sets
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
2006-12-12 20:08:08 +00:00
|
|
|
# Directory (dir)
|
2005-10-12 18:17:10 +00:00
|
|
|
#
|
|
|
|
define(`getattr_dir_perms',`{ getattr }')
|
|
|
|
define(`setattr_dir_perms',`{ setattr }')
|
2009-10-22 13:13:04 +00:00
|
|
|
define(`search_dir_perms',`{ getattr search open }')
|
2008-10-16 16:09:20 +00:00
|
|
|
define(`list_dir_perms',`{ getattr search open read lock ioctl }')
|
|
|
|
define(`add_entry_dir_perms',`{ getattr search open lock ioctl write add_name }')
|
|
|
|
define(`del_entry_dir_perms',`{ getattr search open lock ioctl write remove_name }')
|
|
|
|
define(`rw_dir_perms', `{ open read getattr lock search ioctl add_name remove_name write }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`create_dir_perms',`{ getattr create }')
|
2007-05-03 13:15:48 +00:00
|
|
|
define(`rename_dir_perms',`{ getattr rename }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`delete_dir_perms',`{ getattr rmdir }')
|
2008-05-23 18:22:57 +00:00
|
|
|
define(`manage_dir_perms',`{ create open getattr setattr read write link unlink rename search add_name remove_name reparent rmdir lock ioctl }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`relabelfrom_dir_perms',`{ getattr relabelfrom }')
|
|
|
|
define(`relabelto_dir_perms',`{ getattr relabelto }')
|
|
|
|
define(`relabel_dir_perms',`{ getattr relabelfrom relabelto }')
|
2005-10-12 18:17:10 +00:00
|
|
|
|
|
|
|
#
|
2006-12-12 20:08:08 +00:00
|
|
|
# Regular file (file)
|
2005-06-17 18:56:23 +00:00
|
|
|
#
|
2005-10-12 18:17:10 +00:00
|
|
|
define(`getattr_file_perms',`{ getattr }')
|
|
|
|
define(`setattr_file_perms',`{ setattr }')
|
2008-10-16 16:09:20 +00:00
|
|
|
define(`read_file_perms',`{ getattr open read lock ioctl }')
|
|
|
|
define(`mmap_file_perms',`{ getattr open read execute ioctl }')
|
2009-11-25 15:52:16 +00:00
|
|
|
define(`exec_file_perms',`{ getattr open read execute ioctl execute_no_trans }')
|
2008-10-16 16:09:20 +00:00
|
|
|
define(`append_file_perms',`{ getattr open append lock ioctl }')
|
|
|
|
define(`write_file_perms',`{ getattr open write append lock ioctl }')
|
|
|
|
define(`rw_file_perms',`{ getattr open read write append ioctl lock }')
|
2008-05-23 18:22:57 +00:00
|
|
|
define(`create_file_perms',`{ getattr create open }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`rename_file_perms',`{ getattr rename }')
|
2006-03-02 23:41:11 +00:00
|
|
|
define(`delete_file_perms',`{ getattr unlink }')
|
2008-05-23 18:22:57 +00:00
|
|
|
define(`manage_file_perms',`{ create open getattr setattr read write append rename link unlink ioctl lock }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`relabelfrom_file_perms',`{ getattr relabelfrom }')
|
|
|
|
define(`relabelto_file_perms',`{ getattr relabelto }')
|
|
|
|
define(`relabel_file_perms',`{ getattr relabelfrom relabelto }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Symbolic link (lnk_file)
|
|
|
|
#
|
|
|
|
define(`getattr_lnk_file_perms',`{ getattr }')
|
|
|
|
define(`setattr_lnk_file_perms',`{ setattr }')
|
|
|
|
define(`read_lnk_file_perms',`{ getattr read }')
|
2008-05-22 15:24:52 +00:00
|
|
|
define(`append_lnk_file_perms',`{ getattr append lock ioctl }')
|
|
|
|
define(`write_lnk_file_perms',`{ getattr append write lock ioctl }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`rw_lnk_file_perms',`{ getattr read write lock ioctl }')
|
|
|
|
define(`create_lnk_file_perms',`{ create getattr }')
|
|
|
|
define(`rename_lnk_file_perms',`{ getattr rename }')
|
|
|
|
define(`delete_lnk_file_perms',`{ getattr unlink }')
|
2014-08-23 11:35:50 +00:00
|
|
|
define(`manage_lnk_file_perms',`{ create read write getattr setattr link unlink rename ioctl lock }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`relabelfrom_lnk_file_perms',`{ getattr relabelfrom }')
|
|
|
|
define(`relabelto_lnk_file_perms',`{ getattr relabelto }')
|
|
|
|
define(`relabel_lnk_file_perms',`{ getattr relabelfrom relabelto }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# (Un)named Pipes/FIFOs (fifo_file)
|
|
|
|
#
|
|
|
|
define(`getattr_fifo_file_perms',`{ getattr }')
|
|
|
|
define(`setattr_fifo_file_perms',`{ setattr }')
|
2008-10-16 16:09:20 +00:00
|
|
|
define(`read_fifo_file_perms',`{ getattr open read lock ioctl }')
|
|
|
|
define(`append_fifo_file_perms',`{ getattr open append lock ioctl }')
|
|
|
|
define(`write_fifo_file_perms',`{ getattr open write append lock ioctl }')
|
|
|
|
define(`rw_fifo_file_perms',`{ getattr open read write append ioctl lock }')
|
2008-05-23 18:22:57 +00:00
|
|
|
define(`create_fifo_file_perms',`{ getattr create open }')
|
2007-07-31 15:11:22 +00:00
|
|
|
define(`rename_fifo_file_perms',`{ getattr rename }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`delete_fifo_file_perms',`{ getattr unlink }')
|
2008-05-23 18:22:57 +00:00
|
|
|
define(`manage_fifo_file_perms',`{ create open getattr setattr read write append rename link unlink ioctl lock }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`relabelfrom_fifo_file_perms',`{ getattr relabelfrom }')
|
|
|
|
define(`relabelto_fifo_file_perms',`{ getattr relabelto }')
|
|
|
|
define(`relabel_fifo_file_perms',`{ getattr relabelfrom relabelto }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# (Un)named Sockets (sock_file)
|
|
|
|
#
|
|
|
|
define(`getattr_sock_file_perms',`{ getattr }')
|
|
|
|
define(`setattr_sock_file_perms',`{ setattr }')
|
2009-03-11 14:58:03 +00:00
|
|
|
define(`read_sock_file_perms',`{ getattr open read }')
|
|
|
|
define(`write_sock_file_perms',`{ getattr write open append }')
|
|
|
|
define(`rw_sock_file_perms',`{ getattr open read write append }')
|
|
|
|
define(`create_sock_file_perms',`{ getattr create open }')
|
2007-07-31 15:11:22 +00:00
|
|
|
define(`rename_sock_file_perms',`{ getattr rename }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`delete_sock_file_perms',`{ getattr unlink }')
|
2009-03-11 14:58:03 +00:00
|
|
|
define(`manage_sock_file_perms',`{ create open getattr setattr read write rename link unlink ioctl lock append }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`relabelfrom_sock_file_perms',`{ getattr relabelfrom }')
|
|
|
|
define(`relabelto_sock_file_perms',`{ getattr relabelto }')
|
|
|
|
define(`relabel_sock_file_perms',`{ getattr relabelfrom relabelto }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Block device nodes (blk_file)
|
|
|
|
#
|
|
|
|
define(`getattr_blk_file_perms',`{ getattr }')
|
|
|
|
define(`setattr_blk_file_perms',`{ setattr }')
|
2008-10-16 16:09:20 +00:00
|
|
|
define(`read_blk_file_perms',`{ getattr open read lock ioctl }')
|
|
|
|
define(`append_blk_file_perms',`{ getattr open append lock ioctl }')
|
|
|
|
define(`write_blk_file_perms',`{ getattr open write append lock ioctl }')
|
|
|
|
define(`rw_blk_file_perms',`{ getattr open read write append ioctl lock }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`create_blk_file_perms',`{ getattr create }')
|
|
|
|
define(`rename_blk_file_perms',`{ getattr rename }')
|
|
|
|
define(`delete_blk_file_perms',`{ getattr unlink }')
|
2008-05-23 18:22:57 +00:00
|
|
|
define(`manage_blk_file_perms',`{ create open getattr setattr read write append rename link unlink ioctl lock }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`relabelfrom_blk_file_perms',`{ getattr relabelfrom }')
|
|
|
|
define(`relabelto_blk_file_perms',`{ getattr relabelto }')
|
|
|
|
define(`relabel_blk_file_perms',`{ getattr relabelfrom relabelto }')
|
|
|
|
|
|
|
|
#
|
|
|
|
# Character device nodes (chr_file)
|
|
|
|
#
|
|
|
|
define(`getattr_chr_file_perms',`{ getattr }')
|
|
|
|
define(`setattr_chr_file_perms',`{ setattr }')
|
2008-10-16 16:09:20 +00:00
|
|
|
define(`read_chr_file_perms',`{ getattr open read lock ioctl }')
|
|
|
|
define(`append_chr_file_perms',`{ getattr open append lock ioctl }')
|
|
|
|
define(`write_chr_file_perms',`{ getattr open write append lock ioctl }')
|
|
|
|
define(`rw_chr_file_perms',`{ getattr open read write append ioctl lock }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`create_chr_file_perms',`{ getattr create }')
|
|
|
|
define(`rename_chr_file_perms',`{ getattr rename }')
|
|
|
|
define(`delete_chr_file_perms',`{ getattr unlink }')
|
2008-05-23 18:22:57 +00:00
|
|
|
define(`manage_chr_file_perms',`{ create open getattr setattr read write append rename link unlink ioctl lock }')
|
2006-12-12 20:08:08 +00:00
|
|
|
define(`relabelfrom_chr_file_perms',`{ getattr relabelfrom }')
|
|
|
|
define(`relabelto_chr_file_perms',`{ getattr relabelto }')
|
|
|
|
define(`relabel_chr_file_perms',`{ getattr relabelfrom relabelto }')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Special permission sets
|
|
|
|
#
|
2005-06-17 18:56:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Use (read and write) terminals
|
|
|
|
#
|
2010-10-11 16:03:49 +00:00
|
|
|
define(`rw_term_perms', `{ getattr open read write append ioctl }')
|
2005-07-15 15:53:54 +00:00
|
|
|
|
2006-01-16 18:48:57 +00:00
|
|
|
#
|
|
|
|
# Sockets
|
|
|
|
#
|
|
|
|
define(`client_stream_socket_perms', `{ create ioctl read getattr write setattr append bind getopt setopt shutdown }')
|
|
|
|
define(`server_stream_socket_perms', `{ client_stream_socket_perms listen accept }')
|
2009-11-25 15:52:16 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Keys
|
|
|
|
#
|
|
|
|
define(`manage_key_perms', `{ create link read search setattr view write } ')
|