aboutsummaryrefslogtreecommitdiff
blob: 790f889314c12839e52aafb5780f10bdf76ddf34 (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
## <summary>rtorrent torrent client</summary>

#######################################
## <summary>
## 	Role access for rtorrent
## </summary>
## <param name="user_role">
##      <summary>
##      The role associated with the user domain.
##      </summary>
## </param>
## <param name="user_domain">
##      <summary>
##      The user domain.
##      </summary>
## </param>
#
interface(`rtorrent_role',`
	gen_require(`
		type rtorrent_t, rtorrent_exec_t, rtorrent_home_t, rtorrent_session_t;
	')

	role $1 types rtorrent_t;

	domtrans_pattern($2, rtorrent_exec_t, rtorrent_t)

	allow $2 rtorrent_t:process signal_perms;

	manage_files_pattern($2, rtorrent_home_t, rtorrent_home_t)

	read_files_pattern($2, rtorrent_session_t, rtorrent_session_t)
	list_dirs_pattern($2, rtorrent_session_t, rtorrent_session_t)

	ps_process_pattern($2, rtorrent_t)
')

#######################################
## <summary>
##      Administer the rtorrent application.
## </summary>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
## <param name="role">
##      <summary>
##      Role allowed access.
##      </summary>
## </param>
#
interface(`rtorrent_admin',`
	gen_require(`
		type rtorrent_t;
	')

	allow $1 rtorrent_t:process ptrace;

	rtorrent_role($2, $1)
')