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