]> git.ipfire.org Git - people/stevee/selinux-policy.git/blame - refpolicy/policy/modules/services/gpm.te
add gpm
[people/stevee/selinux-policy.git] / refpolicy / policy / modules / services / gpm.te
CommitLineData
f862c35c
CP
1
2policy_module(gpm,1.0)
3
4########################################
5#
6# Declarations
7#
8
9type gpm_t;
10type gpm_exec_t;
11init_daemon_domain(gpm_t,gpm_exec_t)
12
13type gpm_conf_t;
14files_type(gpm_conf_t)
15
16type gpm_tmp_t;
17files_tmp_file(gpm_tmp_t)
18
19type gpm_var_run_t;
20files_pid_file(gpm_var_run_t)
21
22type gpmctl_t;
23files_type(gpmctl_t)
24
25########################################
26#
27# Local policy
28#
29
30allow gpm_t self:capability { setuid dac_override sys_admin sys_tty_config };
31
32allow gpm_t gpm_conf_t:dir r_dir_perms;
33allow gpm_t gpm_conf_t:file r_file_perms;
34allow gpm_t gpm_conf_t:lnk_file { getattr read };
35
36allow gpm_t gpm_tmp_t:dir create_dir_perms;
37allow gpm_t gpm_tmp_t:file create_file_perms;
38files_create_tmp_files(gpm_t, gpm_tmp_t, { file dir })
39
40allow gpm_t gpm_var_run_t:file create_file_perms;
41files_create_pid(gpm_t,gpm_var_run_t)
42
43allow gpm_t gpmctl_t:sock_file create_file_perms;
44allow gpm_t gpmctl_t:fifo_file create_file_perms;
45dev_create_dev_node(gpm_t,gpmctl_t,{ sock_file fifo_file })
46
47# cjp: this has no effect
48allow gpm_t gpmctl_t:unix_stream_socket name_bind;
49
50kernel_read_kernel_sysctl(gpm_t)
51kernel_list_proc(gpm_t)
52kernel_read_proc_symlinks(gpm_t)
53
54dev_read_sysfs(gpm_t)
55# Access the mouse.
56dev_read_input(gpm_t)
57dev_read_mouse(gpm_t)
58
59fs_getattr_all_fs(gpm_t)
60fs_search_auto_mountpoints(gpm_t)
61
62term_use_unallocated_tty(gpm_t)
63term_dontaudit_use_console(gpm_t)
64
65domain_use_wide_inherit_fd(gpm_t)
66
67init_use_fd(gpm_t)
68init_use_script_pty(gpm_t)
69
70libs_use_ld_so(gpm_t)
71libs_use_shared_libs(gpm_t)
72
73logging_send_syslog_msg(gpm_t)
74
75miscfiles_read_localization(gpm_t)
76
77userdom_dontaudit_use_unpriv_user_fd(gpm_t)
78userdom_dontaudit_search_sysadm_home_dir(gpm_t)
79
80ifdef(`targeted_policy', `
81 term_dontaudit_use_unallocated_tty(gpm_t)
82 term_dontaudit_use_generic_pty(gpm_t)
83 files_dontaudit_read_root_file(gpm_t)
84')
85
86optional_policy(`rhgb.te',`
87 rhgb_domain(gpm_t)
88')
89
90optional_policy(`selinuxutil.te',`
91 seutil_sigchld_newrole(gpm_t)
92')
93
94optional_policy(`udev.te', `
95 udev_read_db(gpm_t)
96')
97
98ifdef(`TODO',`
99# Access the mouse.
100# cjp: why write?
101allow gpm_t { event_device_t mouse_device_t }:chr_file rw_file_perms;
102')