Chris PeBenito a08248
# Home macros
Chris PeBenito a08248
Chris PeBenito a08248
################################################
Chris PeBenito a08248
# network_home(source)
Chris PeBenito a08248
#
Chris PeBenito a08248
# Allows source domain to use a network home
Chris PeBenito a08248
# This includes privileges of create and execute
Chris PeBenito a08248
# as well as the ability to create sockets and fifo
Chris PeBenito a08248
Chris PeBenito a08248
define(`network_home', `
Chris PeBenito a08248
allow $1 autofs_t:dir { search getattr };
Chris PeBenito a08248
Chris PeBenito a08248
if (use_nfs_home_dirs) {
Chris PeBenito a08248
create_dir_file($1, nfs_t)
Chris PeBenito a08248
can_exec($1, nfs_t)
Chris PeBenito a08248
allow $1 nfs_t:{ sock_file fifo_file } create_file_perms;
Chris PeBenito a08248
}
Chris PeBenito a08248
Chris PeBenito a08248
if (use_samba_home_dirs) {
Chris PeBenito a08248
create_dir_file($1, cifs_t)
Chris PeBenito a08248
can_exec($1, cifs_t)
Chris PeBenito a08248
allow $1 cifs_t:{ sock_file fifo_file } create_file_perms;
Chris PeBenito a08248
}
Chris PeBenito a08248
') dnl network_home
Chris PeBenito a08248
Chris PeBenito a08248
################################################
Chris PeBenito a08248
# write_network_home(source)
Chris PeBenito a08248
#
Chris PeBenito a08248
# Allows source domain to create directories and
Chris PeBenito a08248
# files on network file system
Chris PeBenito a08248
Chris PeBenito a08248
define(`write_network_home', `
Chris PeBenito a08248
allow $1 home_root_t:dir search;
Chris PeBenito a08248
Chris PeBenito a08248
if (use_nfs_home_dirs) {
Chris PeBenito a08248
create_dir_file($1, nfs_t)
Chris PeBenito a08248
}
Chris PeBenito a08248
if (use_samba_home_dirs) {
Chris PeBenito a08248
create_dir_file($1, cifs_t)
Chris PeBenito a08248
}
Chris PeBenito a08248
allow $1 autofs_t:dir { search getattr };
Chris PeBenito a08248
') dnl write_network_home
Chris PeBenito a08248
Chris PeBenito a08248
################################################
Chris PeBenito a08248
# read_network_home(source)
Chris PeBenito a08248
#
Chris PeBenito a08248
# Allows source domain to read directories and
Chris PeBenito a08248
# files on network file system
Chris PeBenito a08248
Chris PeBenito a08248
define(`read_network_home', `
Chris PeBenito a08248
allow $1 home_root_t:dir search;
Chris PeBenito a08248
Chris PeBenito a08248
if (use_nfs_home_dirs) {
Chris PeBenito a08248
r_dir_file($1, nfs_t)
Chris PeBenito a08248
}
Chris PeBenito a08248
if (use_samba_home_dirs) {
Chris PeBenito a08248
r_dir_file($1, cifs_t)
Chris PeBenito a08248
}
Chris PeBenito a08248
allow $1 autofs_t:dir { search getattr };
Chris PeBenito a08248
') dnl read_network_home
Chris PeBenito a08248
Chris PeBenito a08248
##################################################
Chris PeBenito a08248
# home_domain_ro_access(source, user, app)
Chris PeBenito a08248
#
Chris PeBenito a08248
# Gives source access to the read-only home
Chris PeBenito a08248
# domain of app for the given user type
Chris PeBenito a08248
Chris PeBenito a08248
define(`home_domain_ro_access', `
Chris PeBenito a08248
allow $1 { home_root_t $2_home_dir_t }:dir { search getattr };
Chris PeBenito a08248
read_network_home($1)
Chris PeBenito a08248
r_dir_file($1, $2_$3_ro_home_t)
Chris PeBenito a08248
') dnl home_domain_ro_access
Chris PeBenito a08248
Chris PeBenito a08248
#################################################
Chris PeBenito a08248
# home_domain_access(source, user, app)
Chris PeBenito a08248
#
Chris PeBenito a08248
# Gives source full access to the home
Chris PeBenito a08248
# domain of app for the given user type
Chris PeBenito a08248
#
Chris PeBenito a08248
# Requires transition in caller
Chris PeBenito a08248
Chris PeBenito a08248
define(`home_domain_access', `
Chris PeBenito a08248
allow $1 { home_root_t $2_home_dir_t }:dir { search getattr };
Chris PeBenito a08248
write_network_home($1)
Chris PeBenito a08248
create_dir_file($1, $2_$3_home_t)
Chris PeBenito a08248
') dnl home_domain_access
Chris PeBenito a08248
Chris PeBenito a08248
####################################################################
Chris PeBenito a08248
# home_domain (prefix, app)
Chris PeBenito a08248
#
Chris PeBenito a08248
# Creates a domain in the prefix home where an application can
Chris PeBenito a08248
# store its settings. It is accessible by the prefix domain.
Chris PeBenito a08248
#
Chris PeBenito a08248
# Requires transition in caller
Chris PeBenito a08248
Chris PeBenito a08248
define(`home_domain', `
Chris PeBenito a08248
Chris PeBenito a08248
# Declare home domain
Chris PeBenito a08248
type $1_$2_home_t, file_type, $1_file_type, sysadmfile, polymember;
Chris PeBenito a08248
typealias $1_$2_home_t alias $1_$2_rw_t;
Chris PeBenito a08248
Chris PeBenito a08248
# User side access
Chris PeBenito a08248
create_dir_file($1_t, $1_$2_home_t)
Chris PeBenito a08248
allow $1_t $1_$2_home_t:{ dir file lnk_file } { relabelfrom relabelto };
Chris PeBenito a08248
Chris PeBenito a08248
# App side access
Chris PeBenito a08248
home_domain_access($1_$2_t, $1, $2)
Chris PeBenito a08248
')
Chris PeBenito a08248
Chris PeBenito a08248
####################################################################
Chris PeBenito a08248
# home_domain_ro (user, app)
Chris PeBenito a08248
#
Chris PeBenito a08248
# Creates a read-only domain in the user home where an application can
Chris PeBenito a08248
# store its settings. It is fully accessible by the user, but
Chris PeBenito a08248
# it is read-only for the application.
Chris PeBenito a08248
#
Chris PeBenito a08248
Chris PeBenito a08248
define(`home_domain_ro', `
Chris PeBenito a08248
Chris PeBenito a08248
# Declare home domain
Chris PeBenito a08248
type $1_$2_ro_home_t, file_type, $1_file_type, sysadmfile;
Chris PeBenito a08248
typealias $1_$2_ro_home_t alias $1_$2_ro_t;
Chris PeBenito a08248
Chris PeBenito a08248
# User side access
Chris PeBenito a08248
create_dir_file($1_t, $1_$2_ro_home_t)
Chris PeBenito a08248
allow $1_t $1_$2_ro_home_t:{ dir file lnk_file } { relabelfrom relabelto };
Chris PeBenito a08248
Chris PeBenito a08248
# App side access
Chris PeBenito a08248
home_domain_ro_access($1_$2_t, $1, $2)
Chris PeBenito a08248
')