Chris PeBenito ab58ad
#DESC hostname - show or set the system host name
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Author: Russell Coker <russell@coker.com.au>
Chris PeBenito ab58ad
# X-Debian-Packages: hostname
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# for setting the hostname
Chris PeBenito ab58ad
daemon_core_rules(hostname, , nosysadm)
Chris PeBenito ab58ad
allow hostname_t self:capability sys_admin;
Chris PeBenito ab58ad
allow hostname_t etc_t:file { getattr read };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow hostname_t { user_tty_type admin_tty_type }:chr_file rw_file_perms;
Chris PeBenito ab58ad
read_locale(hostname_t)
Chris PeBenito ab58ad
can_resolve(hostname_t)
Chris PeBenito ab58ad
allow hostname_t userdomain:fd use;
Chris PeBenito ab58ad
dontaudit hostname_t kernel_t:fd use;
Chris PeBenito ab58ad
allow hostname_t net_conf_t:file { getattr read };
Chris PeBenito ab58ad
allow hostname_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito ab58ad
dontaudit hostname_t var_t:dir search;
Chris PeBenito ab58ad
allow hostname_t fs_t:filesystem getattr;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# for when /usr is not mounted
Chris PeBenito ab58ad
dontaudit hostname_t file_t:dir search;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`distro_redhat', `
Chris PeBenito ab58ad
allow hostname_t tmpfs_t:chr_file rw_file_perms;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
can_access_pty(hostname_t, initrc)
Chris PeBenito ab58ad
allow hostname_t initrc_t:fd use;