aboutsummaryrefslogtreecommitdiff
blob: a88dcccc2d4929816027e0283dab0c1dd86cae61 (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
## <summary>
##	Google Talk
## </summary>

##########################################
## <summary>
##	Grant the plugin domain the needed privileges to launch and
##	interact with the GoogleTalk application. Used for web browser
##	plugin domains.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access
##	</summary>
## </param>
#
interface(`googletalk_plugin_domain',`
	gen_require(`
		type googletalk_plugin_t;
		type googletalk_plugin_xdg_config_t;
	')

	allow $1 googletalk_plugin_t:fd use;
	allow $1 googletalk_plugin_t:unix_stream_socket { read write };

	allow googletalk_plugin_t $1:unix_dgram_socket sendto;

	# GoogleTalk process binds on an unreserved port, the client (plugin)
	# then connects to this port
	corenet_tcp_connect_all_unreserved_ports($1)

	googletalk_domtrans_plugin($1)

	# Create .config/google-googletalkplugin with correct type
	manage_dirs_pattern($1, googletalk_plugin_xdg_config_t, googletalk_plugin_xdg_config_t)
	manage_files_pattern($1, googletalk_plugin_xdg_config_t, googletalk_plugin_xdg_config_t)
	xdg_config_home_filetrans($1, googletalk_plugin_xdg_config_t, dir, "google-googletalkplugin")
	xdg_search_config_home_dirs($1)
')

#######################################
## <summary>
##	Execute Google talk plugin in the Google talk plugin domain
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition
##	</summary>
## </param>
#
interface(`googletalk_domtrans_plugin',`
	gen_require(`
		type googletalk_plugin_t, googletalk_plugin_exec_t;
	')

	corecmd_search_bin($1)
	domtrans_pattern($1, googletalk_plugin_exec_t, googletalk_plugin_t)
')

#######################################
## <summary>
##	Execute Google talk plugin in the Google talk plugin domain,
##	and allow the specified role the google talk plugin domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition
##	</summary>
## </param>
## <param name="role">
##	<summary>
##	Role allowed access
##	</summary>
## </param>
#
interface(`googletalk_run_plugin',`
	gen_require(`
		type googletalk_plugin_t;
	')

	googletalk_domtrans_plugin($1)
	role $2 types googletalk_plugin_t;
')

########################################
## <summary>
##	Use the file descriptor of googletalk plugin
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access
##	</summary>
## </param>
#
interface(`googletalk_use_plugin_fds',`
	gen_require(`
		type googletalk_plugin_t;
	')

	allow $1 googletalk_plugin_t:fd use;
')

########################################
## <summary>
##	Read and write to the google talk plugin inherited stream sockets
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access
##	</summary>
## </param>
#
interface(`googletalk_rw_inherited_plugin_unix_stream_sockets',`
	gen_require(`
		type googletalk_plugin_t;
	')

	allow $1 googletalk_plugin_t:unix_stream_socket { read write };
')

########################################
## <summary>
##	Create objects in the xdg config home location
##	with an automatic type transition to the googletalk
##	plugin xdg config home type
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="object_class">
##	<summary>
##	The class of the object to be created.
##	</summary>
## </param>
## <param name="filename" optional="true">
##	<summary>
##	Name of the file or directory created
##	</summary>
## </param>
#
interface(`googletalk_generic_xdg_config_home_filetrans_plugin_xdg_config',`
	gen_require(`
		type googletalk_plugin_xdg_config_t;
	')

	xdg_config_home_filetrans($1, googletalk_plugin_xdg_config_t, $2, $3)
')

#######################################
## <summary>
##	Manage google talk plugin xdg configuration
## </summary>
## <param name="domain">
## 	<summary>
##	Domain allowed access
##	</summary>
## </param>
#
interface(`googletalk_manage_plugin_xdg_config',`
	gen_require(`
		type googletalk_plugin_xdg_config_t;
	')

	manage_dirs_pattern($1, googletalk_plugin_xdg_config_t, googletalk_plugin_xdg_config_t)
	manage_files_pattern($1, googletalk_plugin_xdg_config_t, googletalk_plugin_xdg_config_t)

	xdg_search_config_home_dirs($1)
')