policy_module(thumb, 1.0.0)
########################################
#
# Declarations
#
type thumb_t;
type thumb_exec_t;
application_domain(thumb_t, thumb_exec_t)
ubac_constrained(thumb_t)
userdom_home_manager(thumb_t)
type thumb_tmp_t;
files_tmp_file(thumb_tmp_t)
ubac_constrained(thumb_tmp_t)
type thumb_home_t;
userdom_user_home_content(thumb_home_t)
type thumb_tmpfs_t;
files_tmpfs_file(thumb_tmpfs_t)
########################################
#
# thumb local policy
#
allow thumb_t self:process { setsched signal setrlimit };
tunable_policy(`deny_execmem',`',`
allow thumb_t self:process execmem;
')
allow thumb_t self:fifo_file manage_fifo_file_perms;
allow thumb_t self:unix_stream_socket create_stream_socket_perms;
allow thumb_t self:netlink_route_socket r_netlink_socket_perms;
allow thumb_t self:udp_socket create_socket_perms;
allow thumb_t self:tcp_socket create_socket_perms;
allow thumb_t self:shm create_shm_perms;
allow thumb_t self:sem create_sem_perms;
manage_dirs_pattern(thumb_t, thumb_home_t, thumb_home_t)
manage_files_pattern(thumb_t, thumb_home_t, thumb_home_t)
userdom_user_home_dir_filetrans(thumb_t, thumb_home_t, dir, ".thumbnails")
userdom_user_home_dir_filetrans(thumb_t, thumb_home_t, file, "missfont.log")
manage_files_pattern(thumb_t, thumb_tmp_t, thumb_tmp_t)
manage_dirs_pattern(thumb_t, thumb_tmp_t, thumb_tmp_t)
manage_sock_files_pattern(thumb_t, thumb_tmp_t, thumb_tmp_t)
exec_files_pattern(thumb_t, thumb_tmp_t, thumb_tmp_t)
files_tmp_filetrans(thumb_t, thumb_tmp_t, { file dir sock_file })
userdom_user_tmp_filetrans(thumb_t, thumb_tmp_t, { file dir sock_file })
xserver_xdm_tmp_filetrans(thumb_t, thumb_tmp_t, sock_file)
manage_dirs_pattern(thumb_t, thumb_tmpfs_t, thumb_tmpfs_t)
manage_files_pattern(thumb_t, thumb_tmpfs_t, thumb_tmpfs_t)
fs_tmpfs_filetrans(thumb_t, thumb_tmpfs_t, { dir file })
can_exec(thumb_t, thumb_exec_t)
kernel_read_system_state(thumb_t)
domain_use_interactive_fds(thumb_t)
corecmd_exec_bin(thumb_t)
corecmd_exec_shell(thumb_t)
dev_read_sysfs(thumb_t)
dev_read_urand(thumb_t)
dev_dontaudit_rw_dri(thumb_t)
dev_rw_xserver_misc(thumb_t)
domain_use_interactive_fds(thumb_t)
files_read_usr_files(thumb_t)
files_read_non_security_files(thumb_t)
fs_getattr_all_fs(thumb_t)
fs_read_dos_files(thumb_t)
fs_rw_inherited_tmpfs_files(thumb_t)
auth_use_nsswitch(thumb_t)
tunable_policy(`selinuxuser_execmod',`
libs_legacy_use_shared_libs(thumb_t)
')
miscfiles_read_fonts(thumb_t)
sysnet_read_config(thumb_t)
userdom_read_user_tmp_files(thumb_t)
userdom_read_user_home_content_files(thumb_t)
userdom_write_user_tmp_files(thumb_t)
userdom_read_home_audio_files(thumb_t)
userdom_home_reader(thumb_t)
userdom_use_user_terminals(thumb_t)
xserver_read_xdm_home_files(thumb_t)
xserver_append_xdm_home_files(thumb_t)
xserver_dontaudit_read_xdm_pid(thumb_t)
xserver_dontaudit_xdm_tmp_dirs(thumb_t)
xserver_stream_connect(thumb_t)
optional_policy(`
dbus_dontaudit_stream_connect_session_bus(thumb_t)
dbus_dontaudit_chat_session_bus(thumb_t)
')
optional_policy(`
# .config
gnome_dontaudit_search_config(thumb_t)
gnome_read_generic_data_home_files(thumb_t)
gnome_manage_gstreamer_home_files(thumb_t)
gnome_manage_gstreamer_home_dirs(thumb_t)
gnome_exec_gstreamer_home_files(thumb_t)
gnome_cache_filetrans(thumb_t, thumb_home_t, dir, "thumbnails")
')