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