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