aboutsummaryrefslogtreecommitdiff
blob: 42946bc10b3f5bcef193f3b4cf58e88ece27d6ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
## <summary>Telepathy communications framework.</summary>

#######################################
## <summary>
##	The template to define a telepathy domain.
## </summary>
## <param name="domain_prefix">
##	<summary>
##	Domain prefix to be used.
##	</summary>
## </param>
#
template(`telepathy_domain_template',`
	gen_require(`
		attribute telepathy_domain, telepathy_executable, telepathy_tmp_content;
	')

	type telepathy_$1_t, telepathy_domain;
	type telepathy_$1_exec_t, telepathy_executable;
	userdom_user_application_domain(telepathy_$1_t, telepathy_$1_exec_t)

	type telepathy_$1_tmp_t, telepathy_tmp_content;
	userdom_user_tmp_file(telepathy_$1_tmp_t)

	auth_use_nsswitch(telepathy_$1_t)
')

#######################################
## <summary>
##	The role template for the telepathy module.
## </summary>
## <desc>
##	<p>
##	This template creates a derived domains which are used
##	for window manager applications.
##	</p>
## </desc>
## <param name="role_prefix">
##	<summary>
##	The prefix of the user domain (e.g., user
##	is the prefix for user_t).
##	</summary>
## </param>
## <param name="user_role">
##	<summary>
##	The role associated with the user domain.
##	</summary>
## </param>
## <param name="user_domain">
##	<summary>
##	The type of the user domain.
##	</summary>
## </param>
#
template(`telepathy_role_template',`
	gen_require(`
		attribute telepathy_domain, telepathy_tmp_content;
		type telepathy_gabble_t, telepathy_sofiasip_t, telepathy_idle_t;
		type telepathy_mission_control_t, telepathy_salut_t, telepathy_sunshine_t;
		type telepathy_stream_engine_t, telepathy_msn_t, telepathy_gabble_exec_t;
		type telepathy_sofiasip_exec_t, telepathy_idle_exec_t;
		type telepathy_logger_t, telepathy_logger_exec_t;
		type telepathy_mission_control_exec_t, telepathy_salut_exec_t;
		type telepathy_sunshine_exec_t, telepathy_stream_engine_exec_t;
		type telepathy_msn_exec_t;

		type telepathy_mission_control_cache_home_t, telepathy_cache_home_t, telepathy_logger_cache_home_t;
		type telepathy_gabble_cache_home_t, telepathy_mission_control_home_t, telepathy_data_home_t;
		type telepathy_mission_control_data_home_t, telepathy_sunshine_home_t, telepathy_logger_data_home_t;
	')

	role $2 types telepathy_domain;

	allow $3 telepathy_domain:process { ptrace signal_perms };
	ps_process_pattern($3, telepathy_domain)

	telepathy_gabble_stream_connect($3)
	telepathy_msn_stream_connect($3)
	telepathy_salut_stream_connect($3)

	dbus_spec_session_domain($1, telepathy_gabble_exec_t, telepathy_gabble_t)
	dbus_spec_session_domain($1, telepathy_sofiasip_exec_t, telepathy_sofiasip_t)
	dbus_spec_session_domain($1, telepathy_idle_exec_t, telepathy_idle_t)
	dbus_spec_session_domain($1, telepathy_logger_exec_t, telepathy_logger_t)
	dbus_spec_session_domain($1, telepathy_mission_control_exec_t, telepathy_mission_control_t)
	dbus_spec_session_domain($1, telepathy_salut_exec_t, telepathy_salut_t)
	dbus_spec_session_domain($1, telepathy_sunshine_exec_t, telepathy_sunshine_t)
	dbus_spec_session_domain($1, telepathy_stream_engine_exec_t, telepathy_stream_engine_t)
	dbus_spec_session_domain($1, telepathy_msn_exec_t, telepathy_msn_t)

	allow $3 { telepathy_mission_control_cache_home_t telepathy_cache_home_t telepathy_logger_cache_home_t }:dir { manage_dir_perms relabel_dir_perms };
	allow $3 { telepathy_gabble_cache_home_t telepathy_mission_control_home_t telepathy_data_home_t }:dir { manage_dir_perms relabel_dir_perms };
	allow $3 { telepathy_mission_control_data_home_t telepathy_sunshine_home_t telepathy_logger_data_home_t }:dir { manage_dir_perms relabel_dir_perms };

	allow $3 { telepathy_mission_control_cache_home_t telepathy_cache_home_t telepathy_logger_cache_home_t }:file { manage_file_perms relabel_file_perms };
	allow $3 { telepathy_gabble_cache_home_t telepathy_mission_control_home_t telepathy_data_home_t }:file { manage_file_perms relabel_file_perms };
	allow $3 { telepathy_mission_control_data_home_t telepathy_sunshine_home_t telepathy_logger_data_home_t }:file { manage_file_perms relabel_file_perms };

	filetrans_pattern($3, telepathy_cache_home_t, telepathy_gabble_cache_home_t, dir, "gabble")
	# gnome_cache_filetrans($3, telepathy_gabble_cache_home_t, dir, "wocky")

	filetrans_pattern($3, telepathy_cache_home_t, telepathy_logger_cache_home_t, dir, "logger")
	# gnome_data_filetrans($3, telepathy_logger_data_home_t, dir, "TpLogger")

	userdom_user_home_dir_filetrans($3, telepathy_mission_control_home_t, dir, ".mission-control")
	filetrans_pattern($3, telepathy_data_home_t, telepathy_mission_control_data_home_t, dir, "mission-control")
	# gnome_cache_filetrans($3, telepathy_mission_control_cache_home_t, file, ".mc_connections")

	userdom_user_home_dir_filetrans($3, telepathy_sunshine_home_t, dir, ".telepathy-sunshine")

	# gnome_cache_filetrans($3, telepathy_cache_home_t, dir, "telepathy")
	# gnome_data_filetrans($3, telepathy_data_home_t, dir, "telepathy")

	allow $3 telepathy_tmp_content:dir { manage_dir_perms relabel_dir_perms };
	allow $3 telepathy_tmp_content:file { manage_file_perms relabel_file_perms };
	allow $3 telepathy_tmp_content:sock_file { manage_sock_file_perms relabel_sock_file_perms };
')

########################################
## <summary>
##	Connect to gabble with a unix
##	domain stream socket.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`telepathy_gabble_stream_connect',`
	gen_require(`
		type telepathy_gabble_t, telepathy_gabble_tmp_t;
	')

	files_search_tmp($1)
	stream_connect_pattern($1, telepathy_gabble_tmp_t, telepathy_gabble_tmp_t, telepathy_gabble_t)
')

########################################
## <summary>
##	Send dbus messages to and from
##	gabble.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`telepathy_gabble_dbus_chat',`
	gen_require(`
		type telepathy_gabble_t;
		class dbus send_msg;
	')

	allow $1 telepathy_gabble_t:dbus send_msg;
	allow telepathy_gabble_t $1:dbus send_msg;
')

########################################
## <summary>
##	Read mission control process state files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`telepathy_mission_control_read_state',`
	gen_require(`
		type telepathy_mission_control_t;
	')

	kernel_search_proc($1)
	allow $1 telepathy_mission_control_t:dir list_dir_perms;
	allow $1 telepathy_mission_control_t:file read_file_perms;
	allow $1 telepathy_mission_control_t:lnk_file read_lnk_file_perms;
')

#######################################
## <summary>
##	Connect to msn with a unix
##	domain stream socket.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`telepathy_msn_stream_connect',`
	gen_require(`
		type telepathy_msn_t, telepathy_msn_tmp_t;
	')

	files_search_tmp($1)
	stream_connect_pattern($1, telepathy_msn_tmp_t, telepathy_msn_tmp_t, telepathy_msn_t)
')

########################################
## <summary>
##	Connect to salut with a unix
##	domain stream socket.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`telepathy_salut_stream_connect',`
	gen_require(`
		type telepathy_salut_t, telepathy_salut_tmp_t;
	')

	files_search_tmp($1)
	stream_connect_pattern($1, telepathy_salut_tmp_t, telepathy_salut_tmp_t, telepathy_salut_t)
')