Blame mls/domains/program/tftpd.te
|
Chris PeBenito |
31b7c0 |
#DESC TFTP - UDP based file server for boot loaders
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
# Author: Russell Coker <russell@coker.com.au>
|
|
Chris PeBenito |
31b7c0 |
# X-Debian-Packages: tftpd atftpd
|
|
Chris PeBenito |
31b7c0 |
# Depends: inetd.te
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
#################################
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
# Rules for the tftpd_t domain.
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
# tftpd_exec_t is the type of the tftpd executable.
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
daemon_domain(tftpd)
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
# tftpdir_t is the type of files in the /tftpboot directories.
|
|
Chris PeBenito |
31b7c0 |
type tftpdir_t, file_type, sysadmfile;
|
|
Chris PeBenito |
31b7c0 |
r_dir_file(tftpd_t, tftpdir_t)
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
domain_auto_trans(inetd_t, tftpd_exec_t, tftpd_t)
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
# Use the network.
|
|
Chris PeBenito |
31b7c0 |
can_network_udp(tftpd_t)
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t tftp_port_t:udp_socket name_bind;
|
|
Chris PeBenito |
31b7c0 |
ifdef(`inetd.te', `
|
|
Chris PeBenito |
31b7c0 |
allow inetd_t tftp_port_t:udp_socket name_bind;
|
|
Chris PeBenito |
31b7c0 |
')
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
# allow any domain to connect to the TFTP server
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t inetd_t:udp_socket rw_socket_perms;
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
# Use capabilities
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t self:capability { setgid setuid net_bind_service sys_chroot };
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t etc_t:dir r_dir_perms;
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t etc_t:file r_file_perms;
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t var_t:dir r_dir_perms;
|
|
Chris PeBenito |
31b7c0 |
allow tftpd_t var_t:{ file lnk_file } r_file_perms;
|