Blame targeted/macros/program/ice_macros.te
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# ICE related types
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Author: Ivan Gyurdiev <ivg2@cornell.edu>
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# ice_domain(prefix, role) - create ICE sockets
|
|
Chris PeBenito |
ab58ad |
# ice_connect(type1_prefix, type2_prefix) - allow communication through ICE sockets
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
define(`ice_domain', `
|
|
Chris PeBenito |
ab58ad |
ifdef(`$1_ice_tmp_t_defined',`', `
|
|
Chris PeBenito |
ab58ad |
define(`$1_ice_tmp_t_defined')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Type for ICE sockets
|
|
Chris PeBenito |
ab58ad |
type $1_ice_tmp_t, file_type, $1_file_type, sysadmfile, tmpfile;
|
|
Chris PeBenito |
ab58ad |
file_type_auto_trans($1_t, ice_tmp_t, $1_ice_tmp_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Create the sockets
|
|
Chris PeBenito |
ab58ad |
allow $1_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
ab58ad |
allow $1_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# FIXME: How does iceauth tie in?
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# FIXME: Should this be bidirectional?
|
|
Chris PeBenito |
ab58ad |
# Adding only unidirectional for now.
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
define(`ice_connect', `
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Read .ICEauthority file
|
|
Chris PeBenito |
ab58ad |
allow $1_t $2_iceauth_home_t:file { read getattr };
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
can_unix_connect($1_t, $2_t)
|
|
Chris PeBenito |
ab58ad |
allow $1_t ice_tmp_t:dir r_dir_perms;
|
|
Chris PeBenito |
ab58ad |
allow $1_t $2_ice_tmp_t:sock_file { read write };
|
|
Chris PeBenito |
ab58ad |
allow $1_t $2_t:unix_stream_socket { read write };
|
|
Chris PeBenito |
ab58ad |
')
|