[selinux-policy: 406/3172] more setcurrent stuff

Daniel J Walsh dwalsh at fedoraproject.org
Thu Oct 7 19:39:53 UTC 2010


commit 007ca5600cfbb352d83ba1b2d61ca25fae248df8
Author: Chris PeBenito <cpebenito at tresys.com>
Date:   Thu Jun 23 15:37:39 2005 +0000

    more setcurrent stuff

 refpolicy/policy/modules/system/domain.if |   16 ++++++++++++++--
 refpolicy/policy/modules/system/domain.te |    6 +++++-
 2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/refpolicy/policy/modules/system/domain.if b/refpolicy/policy/modules/system/domain.if
index 3cec277..4088072 100644
--- a/refpolicy/policy/modules/system/domain.if
+++ b/refpolicy/policy/modules/system/domain.if
@@ -80,6 +80,18 @@ interface(`domain_wide_inherit_fd',`
 ')
 
 ########################################
+#
+# domain_dyntrans_type(domain)
+#
+interface(`domain_dyntrans_type',`
+	gen_require(`
+		attribute set_curr_context;
+	')
+
+	typeattribute $1 set_curr_context;
+')
+
+########################################
 ## <interface name="domain_subj_id_change_exempt">
 ##	<description>
 ## 		Makes caller an exception to the constraint preventing
@@ -461,7 +473,7 @@ interface(`domain_read_all_entry_files',`
 #
 # domain_trans(source_domain,entrypoint_file,target_domain)
 #
-interface(`domain_trans',`
+define(`domain_trans',`
 	gen_require(`
 		class file rx_file_perms;
 		process { transition noatsecure siginh rlimitinh };
@@ -476,7 +488,7 @@ interface(`domain_trans',`
 #
 # domain_auto_trans(source_domain,entrypoint_file,target_domain)
 #
-interface(`domain_auto_trans',`
+define(`domain_auto_trans',`
 	domain_trans($1,$2,$3)
 	type_transition $1 $2:process $3;
 ')
diff --git a/refpolicy/policy/modules/system/domain.te b/refpolicy/policy/modules/system/domain.te
index 6891c30..be824fb 100644
--- a/refpolicy/policy/modules/system/domain.te
+++ b/refpolicy/policy/modules/system/domain.te
@@ -10,6 +10,10 @@ attribute entry_type;
 # widely-inheritable file descriptors
 attribute privfd;
 
+# Domains that can set their current context
+# (perform dynamic transitions)
+attribute set_curr_context;
+
 # constraint related attributes
 attribute can_change_process_identity;
 attribute can_change_process_role;
@@ -21,7 +25,7 @@ neverallow domain ~domain:process { transition dyntransition };
 # enabling setcurrent breaks process tranquility.  If you do not
 # know what this means or do not understand the implications of a
 # dynamic transition, you should not be using it!!!
-neverallow * *:process setcurrent;
+neverallow { domain -set_curr_context } self:process setcurrent;
 
 # Files with domain types are currently only proc files
 neverallow * domain:dir ~r_dir_perms;


More information about the scm-commits mailing list