Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# ORBit related types 
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author: Ivan Gyurdiev <ivg2@cornell.edu>
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# orbit_domain(prefix, role_prefix) - create ORBit sockets
Chris PeBenito 31b7c0
# orbit_connect(type1_prefix, type2_prefix) 
Chris PeBenito 31b7c0
#	- allow communication through ORBit sockets from type1 to type2 
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`orbit_domain', `
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Protect against double inclusion for speed and correctness
Chris PeBenito 31b7c0
ifdef(`orbit_domain_$1_$2', `', `
Chris PeBenito 31b7c0
define(`orbit_domain_$1_$2')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Relabel directory (startup script)
Chris PeBenito 31b7c0
allow $1_t $1_orbit_tmp_t:{ dir file } { relabelfrom relabelto };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Type for ORBit sockets
Chris PeBenito 31b7c0
type $1_orbit_tmp_t, file_type, $2_file_type, sysadmfile, tmpfile;
Chris PeBenito 31b7c0
file_type_auto_trans($1_t, $2_orbit_tmp_t, $1_orbit_tmp_t)
Chris PeBenito 31b7c0
allow $1_t tmp_t:dir { read search getattr };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Create the sockets
Chris PeBenito 31b7c0
allow $1_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 31b7c0
allow $1_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Use random device(s)
Chris PeBenito 31b7c0
allow $1_t { random_device_t urandom_device_t }:chr_file { read getattr ioctl };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Why do they do that?
Chris PeBenito 31b7c0
dontaudit $1_t $2_orbit_tmp_t:dir setattr;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
') dnl ifdef orbit_domain_args
Chris PeBenito 31b7c0
') dnl orbit_domain
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
##########################
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`orbit_connect', `
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_unix_connect($1_t, $2_t)
Chris PeBenito 31b7c0
allow $1_t $2_orbit_tmp_t:sock_file write;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
') dnl orbit_connect