aboutsummaryrefslogtreecommitdiff
blob: 38bb3127d05e1224b194fca19dd79e2abcace15e (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
## <summary>Trivial file transfer protocol daemon</summary>

########################################
## <summary>
##	Read tftp content
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`tftp_read_content',`
	gen_require(`
		type tftpdir_t;
	')

	read_files_pattern($1, tftpdir_t, tftpdir_t)
')

########################################
## <summary>
##	Manage tftp /var/lib files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`tftp_manage_rw_content',`
	gen_require(`
		type tftpdir_rw_t;
	')

	files_search_var_lib($1)
	manage_dirs_pattern($1, tftpdir_rw_t, tftpdir_rw_t)
	manage_files_pattern($1, tftpdir_rw_t, tftpdir_rw_t)
')

########################################
## <summary>
##	All of the rules required to administrate
##	an tftp environment
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <rolecap/>
#
interface(`tftp_admin',`
	gen_require(`
		type tftpd_t, tftpdir_t, tftpdir_rw_t, tftpd_var_run_t;
	')

	allow $1 tftpd_t:process { ptrace signal_perms getattr };
	ps_process_pattern($1, tftpd_t)

	admin_pattern($1, tftpdir_rw_t)

	admin_pattern($1, tftpdir_t)

	files_list_pids($1)
	admin_pattern($1, tftpd_var_run_t)
')