1ee0a31
commit f53f820fe366940d4fdecaef80de4e5b1178fac6
1ee0a31
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a31
Date:   Thu Jun 7 01:38:59 2012 +0200
1ee0a31
1ee0a31
    roleattribute patch
1ee0a31
1ee0a31
diff --git a/livecd.if b/livecd.if
1ee0a31
index bfbf676..fb7869e 100644
1ee0a31
--- a/livecd.if
1ee0a31
+++ b/livecd.if
1ee0a31
@@ -38,12 +38,19 @@ interface(`livecd_run',`
1ee0a31
 	gen_require(`
1ee0a31
 		type livecd_t;
1ee0a31
 		type livecd_exec_t;
1ee0a31
-		attribute_role livecd_roles;
1ee0a31
+		#attribute_role livecd_roles;
1ee0a31
 	')
1ee0a31
 
1ee0a31
 	livecd_domtrans($1)
1ee0a31
-	roleattribute $2 livecd_roles;
1ee0a31
+	#roleattribute $2 livecd_roles;
1ee0a31
+	role $2 types livecd_t;
1ee0a31
 	role_transition $2 livecd_exec_t system_r;
1ee0a31
+
1ee0a31
+        seutil_run_setfiles_mac(livecd_t, system_r)
1ee0a31
+
1ee0a31
+        optional_policy(`
1ee0a31
+                mount_run(livecd_t, $2)
1ee0a31
+        ')
1ee0a31
 ')
1ee0a31
 
1ee0a31
 ########################################
1ee0a31
diff --git a/livecd.te b/livecd.te
1ee0a31
index 65efdae..7a944b5 100644
1ee0a31
--- a/livecd.te
1ee0a31
+++ b/livecd.te
1ee0a31
@@ -5,13 +5,14 @@ policy_module(livecd, 1.2.0)
1ee0a31
 # Declarations
1ee0a31
 #
1ee0a31
 
1ee0a31
-attribute_role livecd_roles;
1ee0a31
-roleattribute system_r livecd_roles;
1ee0a31
+#attribute_role livecd_roles;
1ee0a31
+#roleattribute system_r livecd_roles;
1ee0a31
 
1ee0a31
 type livecd_t;
1ee0a31
 type livecd_exec_t;
1ee0a31
 application_domain(livecd_t, livecd_exec_t)
1ee0a31
-role livecd_roles types livecd_t;
1ee0a31
+role system_r types livecd_t;
1ee0a31
+#role livecd_roles types livecd_t;
1ee0a31
 
1ee0a31
 type livecd_tmp_t;
1ee0a31
 files_tmp_file(livecd_tmp_t)
1ee0a31
@@ -35,10 +36,10 @@ term_filetrans_all_named_dev(livecd_t)
1ee0a31
 
1ee0a31
 sysnet_filetrans_named_content(livecd_t)
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	mount_run(livecd_t, livecd_roles)
1ee0a31
-	seutil_run_setfiles_mac(livecd_t, livecd_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	mount_run(livecd_t, livecd_roles)
1ee0a31
+#	seutil_run_setfiles_mac(livecd_t, livecd_roles)
1ee0a31
+#')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
 	ssh_filetrans_admin_home_content(livecd_t)
1ee0a31
diff --git a/mozilla.if b/mozilla.if
1ee0a31
index 30b0241..30bfefb 100644
1ee0a31
--- a/mozilla.if
1ee0a31
+++ b/mozilla.if
1ee0a31
@@ -18,10 +18,11 @@
1ee0a31
 interface(`mozilla_role',`
1ee0a31
 	gen_require(`
1ee0a31
 		type mozilla_t, mozilla_exec_t, mozilla_home_t;
1ee0a31
-		attribute_role mozilla_roles;
1ee0a31
+		#attribute_role mozilla_roles;
1ee0a31
 	')
1ee0a31
 
1ee0a31
-	roleattribute $1 mozilla_roles;
1ee0a31
+	#roleattribute $1 mozilla_roles;
1ee0a31
+	role $1 types mozilla_t;
1ee0a31
 
1ee0a31
 	domain_auto_trans($2, mozilla_exec_t, mozilla_t)
1ee0a31
 	# Unrestricted inheritance from the caller.
1ee0a31
@@ -47,6 +48,8 @@ interface(`mozilla_role',`
1ee0a31
 	relabel_files_pattern($2, mozilla_home_t, mozilla_home_t)
1ee0a31
 	relabel_lnk_files_pattern($2, mozilla_home_t, mozilla_home_t)
1ee0a31
 
1ee0a31
+	#should be remove then with adding of roleattribute
1ee0a31
+	mozilla_run_plugin(mozilla_t, $1)
1ee0a31
 	mozilla_dbus_chat($2)
1ee0a31
 
1ee0a31
 	userdom_manage_tmp_role($1, mozilla_t)
1ee0a31
@@ -63,7 +66,6 @@ interface(`mozilla_role',`
1ee0a31
 
1ee0a31
 	mozilla_filetrans_home_content($2)
1ee0a31
 
1ee0a31
-	mozilla_dbus_chat($2)
1ee0a31
 ')
1ee0a31
 
1ee0a31
 ########################################
1ee0a31
diff --git a/mozilla.te b/mozilla.te
1ee0a31
index 7bf56bf..56700a4 100644
1ee0a31
--- a/mozilla.te
1ee0a31
+++ b/mozilla.te
1ee0a31
@@ -19,14 +19,15 @@ gen_tunable(mozilla_read_content, false)
1ee0a31
 ## </desc>
1ee0a31
 gen_tunable(mozilla_plugin_enable_homedirs, false)
1ee0a31
 
1ee0a31
-attribute_role mozilla_roles;
1ee0a31
+#attribute_role mozilla_roles;
1ee0a31
 
1ee0a31
 type mozilla_t;
1ee0a31
 type mozilla_exec_t;
1ee0a31
 typealias mozilla_t alias { user_mozilla_t staff_mozilla_t sysadm_mozilla_t };
1ee0a31
 typealias mozilla_t alias { auditadm_mozilla_t secadm_mozilla_t };
1ee0a31
 userdom_user_application_domain(mozilla_t, mozilla_exec_t)
1ee0a31
-role mozilla_roles types mozilla_t;
1ee0a31
+#role mozilla_roles types mozilla_t;
1ee0a31
+role system_r types mozilla_t;
1ee0a31
 
1ee0a31
 type mozilla_conf_t;
1ee0a31
 files_config_file(mozilla_conf_t)
1ee0a31
@@ -39,7 +40,8 @@ userdom_user_home_content(mozilla_home_t)
1ee0a31
 type mozilla_plugin_t;
1ee0a31
 type mozilla_plugin_exec_t;
1ee0a31
 application_domain(mozilla_plugin_t, mozilla_plugin_exec_t)
1ee0a31
-role mozilla_roles types mozilla_plugin_t;
1ee0a31
+#role mozilla_roles types mozilla_plugin_t;
1ee0a31
+role system_r types mozilla_plugin_t;
1ee0a31
 
1ee0a31
 type mozilla_plugin_tmp_t;
1ee0a31
 userdom_user_tmp_content(mozilla_plugin_tmp_t)
1ee0a31
@@ -55,7 +57,8 @@ files_type(mozilla_plugin_rw_t)
1ee0a31
 type mozilla_plugin_config_t;
1ee0a31
 type mozilla_plugin_config_exec_t;
1ee0a31
 application_domain(mozilla_plugin_config_t, mozilla_plugin_config_exec_t)
1ee0a31
-role mozilla_roles types mozilla_plugin_config_t;
1ee0a31
+#role mozilla_roles types mozilla_plugin_config_t;
1ee0a31
+role system_r types mozilla_plugin_config_t;
1ee0a31
 
1ee0a31
 type mozilla_tmp_t;
1ee0a31
 userdom_user_tmp_file(mozilla_tmp_t)
1ee0a31
@@ -186,7 +189,7 @@ sysnet_dns_name_resolve(mozilla_t)
1ee0a31
 
1ee0a31
 userdom_use_inherited_user_ptys(mozilla_t)
1ee0a31
 
1ee0a31
-mozilla_run_plugin(mozilla_t, mozilla_roles)
1ee0a31
+#mozilla_run_plugin(mozilla_t, mozilla_roles)
1ee0a31
 
1ee0a31
 xserver_user_x_domain_template(mozilla, mozilla_t, mozilla_tmpfs_t)
1ee0a31
 xserver_dontaudit_read_xdm_tmp_files(mozilla_t)
1ee0a31
@@ -298,7 +301,8 @@ optional_policy(`
1ee0a31
 ')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
-	pulseaudio_role(mozilla_roles, mozilla_t)
1ee0a31
+	#pulseaudio_role(mozilla_roles, mozilla_t)
1ee0a31
+	pulseaudio_exec(mozilla_t)
1ee0a31
 	pulseaudio_stream_connect(mozilla_t)
1ee0a31
 	pulseaudio_manage_home_files(mozilla_t)
1ee0a31
 ')
1ee0a31
@@ -476,9 +480,9 @@ optional_policy(`
1ee0a31
 	java_exec(mozilla_plugin_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	lpd_run_lpr(mozilla_plugin_t, mozilla_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	lpd_run_lpr(mozilla_plugin_t, mozilla_roles)
1ee0a31
+#')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
 	mplayer_exec(mozilla_plugin_t)
1ee0a31
diff --git a/ncftool.if b/ncftool.if
1ee0a31
index 1520b6c..3a4455f 100644
1ee0a31
--- a/ncftool.if
1ee0a31
+++ b/ncftool.if
1ee0a31
@@ -36,10 +36,18 @@ interface(`ncftool_domtrans',`
1ee0a31
 #
1ee0a31
 interface(`ncftool_run',`
1ee0a31
 	gen_require(`
1ee0a31
-		attribute_role ncftool_roles;
1ee0a31
+		type ncftool_t;
1ee0a31
+		#attribute_role ncftool_roles;
1ee0a31
         ')
1ee0a31
 
1ee0a31
-        ncftool_domtrans($1)
1ee0a31
-        roleattribute $2 ncftool_roles;
1ee0a31
+        #ncftool_domtrans($1)
1ee0a31
+        #roleattribute $2 ncftool_roles;
1ee0a31
+
1ee0a31
+	role $1 types ncftool_t;
1ee0a31
+
1ee0a31
+        ncftool_domtrans($2)
1ee0a31
+
1ee0a31
+        ps_process_pattern($2, ncftool_t)
1ee0a31
+        allow $2 ncftool_t:process signal;
1ee0a31
 ')
1ee0a31
 
1ee0a31
diff --git a/ncftool.te b/ncftool.te
1ee0a31
index 91ab36d..8c48c33 100644
1ee0a31
--- a/ncftool.te
1ee0a31
+++ b/ncftool.te
1ee0a31
@@ -5,15 +5,16 @@ policy_module(ncftool, 1.1.0)
1ee0a31
 # Declarations
1ee0a31
 #
1ee0a31
 
1ee0a31
-attribute_role ncftool_roles;
1ee0a31
-roleattribute system_r ncftool_roles;
1ee0a31
+#attribute_role ncftool_roles;
1ee0a31
+#roleattribute system_r ncftool_roles;
1ee0a31
 
1ee0a31
 type ncftool_t;
1ee0a31
 type ncftool_exec_t;
1ee0a31
 application_domain(ncftool_t, ncftool_exec_t)
1ee0a31
 domain_obj_id_change_exemption(ncftool_t)
1ee0a31
 domain_system_change_exemption(ncftool_t)
1ee0a31
-role ncftool_roles types ncftool_t;
1ee0a31
+#role ncftool_roles types ncftool_t;
1ee0a31
+role system_r types ncftool_t;
1ee0a31
 
1ee0a31
 ########################################
1ee0a31
 #
1ee0a31
@@ -53,8 +54,10 @@ term_use_all_inherited_terms(ncftool_t)
1ee0a31
 
1ee0a31
 miscfiles_read_localization(ncftool_t)
1ee0a31
 sysnet_delete_dhcpc_pid(ncftool_t)
1ee0a31
-sysnet_run_dhcpc(ncftool_t, ncftool_roles)
1ee0a31
-sysnet_run_ifconfig(ncftool_t, ncftool_roles)
1ee0a31
+sysnet_domtrans_dhcpc(ncftool_t)
1ee0a31
+sysnet_domtrans_ifconfig(ncftool_t)
1ee0a31
+#sysnet_run_dhcpc(ncftool_t, ncftool_roles)
1ee0a31
+#sysnet_run_ifconfig(ncftool_t, ncftool_roles)
1ee0a31
 sysnet_etc_filetrans_config(ncftool_t)
1ee0a31
 sysnet_manage_config(ncftool_t)
1ee0a31
 sysnet_read_dhcpc_state(ncftool_t)
1ee0a31
@@ -66,9 +69,9 @@ sysnet_signal_dhcpc(ncftool_t)
1ee0a31
 userdom_use_user_terminals(ncftool_t)
1ee0a31
 userdom_read_user_tmp_files(ncftool_t)
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	brctl_run(ncftool_t, ncftool_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	brctl_run(ncftool_t, ncftool_roles)
1ee0a31
+#')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
 	consoletype_exec(ncftool_t)
1ee0a31
@@ -85,9 +88,12 @@ optional_policy(`
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
 	modutils_read_module_config(ncftool_t)
1ee0a31
-	modutils_run_insmod(ncftool_t, ncftool_roles)
1ee0a31
+	modutils_domtrans_insmod(ncftool_t)
1ee0a31
+	#modutils_run_insmod(ncftool_t, ncftool_roles)
1ee0a31
+
1ee0a31
 ')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
-	netutils_run(ncftool_t, ncftool_roles)
1ee0a31
+	netutils_domtrans(ncftool_t)
1ee0a31
+	#netutils_run(ncftool_t, ncftool_roles)
1ee0a31
 ')
1ee0a31
diff --git a/ppp.if b/ppp.if
1ee0a31
index c174b05..a4cad0b 100644
1ee0a31
--- a/ppp.if
1ee0a31
+++ b/ppp.if
1ee0a31
@@ -175,11 +175,18 @@ interface(`ppp_run_cond',`
1ee0a31
 #
1ee0a31
 interface(`ppp_run',`
1ee0a31
 	gen_require(`
1ee0a31
-		attribute_role pppd_roles;
1ee0a31
+		#attribute_role pppd_roles;
1ee0a31
+		type pppd_t;
1ee0a31
 	')
1ee0a31
 
1ee0a31
-	ppp_domtrans($1)
1ee0a31
-	roleattribute $2 pppd_roles;
1ee0a31
+	#ppp_domtrans($1)
1ee0a31
+	#roleattribute $2 pppd_roles;
1ee0a31
+
1ee0a31
+	role $2 types pppd_t;
1ee0a31
+
1ee0a31
+        tunable_policy(`pppd_for_user',`
1ee0a31
+                ppp_domtrans($1)
1ee0a31
+        ')
1ee0a31
 ')
1ee0a31
 
1ee0a31
 ########################################
1ee0a31
diff --git a/ppp.te b/ppp.te
1ee0a31
index 17e10a2..92cec2b 100644
1ee0a31
--- a/ppp.te
1ee0a31
+++ b/ppp.te
1ee0a31
@@ -19,14 +19,15 @@ gen_tunable(pppd_can_insmod, false)
1ee0a31
 ## </desc>
1ee0a31
 gen_tunable(pppd_for_user, false)
1ee0a31
 
1ee0a31
-attribute_role pppd_roles;
1ee0a31
+#attribute_role pppd_roles;
1ee0a31
 
1ee0a31
 # pppd_t is the domain for the pppd program.
1ee0a31
 # pppd_exec_t is the type of the pppd executable.
1ee0a31
 type pppd_t;
1ee0a31
 type pppd_exec_t;
1ee0a31
 init_daemon_domain(pppd_t, pppd_exec_t)
1ee0a31
-role pppd_roles types pppd_t;
1ee0a31
+#role pppd_roles types pppd_t;
1ee0a31
+role system_r types pppd_t;
1ee0a31
 
1ee0a31
 type pppd_devpts_t;
1ee0a31
 term_pty(pppd_devpts_t)
1ee0a31
@@ -64,7 +65,8 @@ files_pid_file(pppd_var_run_t)
1ee0a31
 type pptp_t;
1ee0a31
 type pptp_exec_t;
1ee0a31
 init_daemon_domain(pptp_t, pptp_exec_t)
1ee0a31
-role pppd_roles types pptp_t;
1ee0a31
+#role pppd_roles types pptp_t;
1ee0a31
+role system_r types pptp_t;
1ee0a31
 
1ee0a31
 type pptp_log_t;
1ee0a31
 logging_log_file(pptp_log_t)
1ee0a31
@@ -176,7 +178,8 @@ init_dontaudit_write_utmp(pppd_t)
1ee0a31
 init_signal_script(pppd_t)
1ee0a31
 
1ee0a31
 auth_use_nsswitch(pppd_t)
1ee0a31
-auth_run_chk_passwd(pppd_t,pppd_roles)
1ee0a31
+auth_domtrans_chk_passwd(pppd_t)
1ee0a31
+#auth_run_chk_passwd(pppd_t,pppd_roles)
1ee0a31
 auth_write_login_records(pppd_t)
1ee0a31
 
1ee0a31
 logging_send_syslog_msg(pppd_t)
1ee0a31
@@ -196,7 +199,8 @@ userdom_search_admin_dir(pppd_t)
1ee0a31
 ppp_exec(pppd_t)
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
-	ddclient_run(pppd_t, pppd_roles)
1ee0a31
+	#ddclient_run(pppd_t, pppd_roles)
1ee0a31
+	ddclient_domtrans(pppd_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
diff --git a/usernetctl.if b/usernetctl.if
1ee0a31
index d45c715..2d4f1ba 100644
1ee0a31
--- a/usernetctl.if
1ee0a31
+++ b/usernetctl.if
1ee0a31
@@ -37,9 +37,26 @@ interface(`usernetctl_domtrans',`
1ee0a31
 #
1ee0a31
 interface(`usernetctl_run',`
1ee0a31
 	gen_require(`
1ee0a31
-		attribute_role usernetctl_roles;
1ee0a31
+		type usernetctl_t;
1ee0a31
+		#attribute_role usernetctl_roles;
1ee0a31
 	')
1ee0a31
 
1ee0a31
-	usernetctl_domtrans($1)
1ee0a31
-	roleattribute $2 usernetctl_roles;
1ee0a31
+	#usernetctl_domtrans($1)
1ee0a31
+	#roleattribute $2 usernetctl_roles;
1ee0a31
+
1ee0a31
+	sysnet_run_ifconfig(usernetctl_t, $2)
1ee0a31
+        sysnet_run_dhcpc(usernetctl_t, $2)
1ee0a31
+
1ee0a31
+        optional_policy(`
1ee0a31
+                iptables_run(usernetctl_t, $2)
1ee0a31
+        ')
1ee0a31
+
1ee0a31
+        optional_policy(`
1ee0a31
+                modutils_run_insmod(usernetctl_t, $2)
1ee0a31
+        ')
1ee0a31
+
1ee0a31
+        optional_policy(`
1ee0a31
+                ppp_run(usernetctl_t, $2)
1ee0a31
+        ')
1ee0a31
+
1ee0a31
 ')
1ee0a31
diff --git a/usernetctl.te b/usernetctl.te
1ee0a31
index 8604c1c..35b12a6 100644
1ee0a31
--- a/usernetctl.te
1ee0a31
+++ b/usernetctl.te
1ee0a31
@@ -5,13 +5,14 @@ policy_module(usernetctl, 1.6.0)
1ee0a31
 # Declarations
1ee0a31
 #
1ee0a31
 
1ee0a31
-attribute_role usernetctl_roles;
1ee0a31
+#attribute_role usernetctl_roles;
1ee0a31
 
1ee0a31
 type usernetctl_t;
1ee0a31
 type usernetctl_exec_t;
1ee0a31
 application_domain(usernetctl_t, usernetctl_exec_t)
1ee0a31
 domain_interactive_fd(usernetctl_t)
1ee0a31
-role usernetctl_roles types usernetctl_t;
1ee0a31
+#role usernetctl_roles types usernetctl_t;
1ee0a31
+role system_r types usernetctl_t;
1ee0a31
 
1ee0a31
 ########################################
1ee0a31
 #
1ee0a31
@@ -63,29 +64,30 @@ sysnet_read_config(usernetctl_t)
1ee0a31
 
1ee0a31
 userdom_use_inherited_user_terminals(usernetctl_t)
1ee0a31
 
1ee0a31
-sysnet_run_ifconfig(usernetctl_t, usernetctl_roles)
1ee0a31
-sysnet_run_dhcpc(usernetctl_t, usernetctl_roles)
1ee0a31
+#sysnet_run_ifconfig(usernetctl_t, usernetctl_roles)
1ee0a31
+#sysnet_run_dhcpc(usernetctl_t, usernetctl_roles)
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
-	consoletype_run(usernetctl_t, usernetctl_roles)
1ee0a31
+	#consoletype_run(usernetctl_t, usernetctl_roles)
1ee0a31
+	consoletype_exec(usernetctl_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
 	hostname_exec(usernetctl_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	iptables_run(usernetctl_t, usernetctl_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	iptables_run(usernetctl_t, usernetctl_roles)
1ee0a31
+#')
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	modutils_run_insmod(usernetctl_t, usernetctl_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	modutils_run_insmod(usernetctl_t, usernetctl_roles)
1ee0a31
+#')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
 	nis_use_ypbind(usernetctl_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	ppp_run(usernetctl_t, usernetctl_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	ppp_run(usernetctl_t, usernetctl_roles)
1ee0a31
+#')
1ee0a31
diff --git a/vpn.if b/vpn.if
1ee0a31
index 7b93e07..a4e2f60 100644
1ee0a31
--- a/vpn.if
1ee0a31
+++ b/vpn.if
1ee0a31
@@ -37,11 +37,16 @@ interface(`vpn_domtrans',`
1ee0a31
 #
1ee0a31
 interface(`vpn_run',`
1ee0a31
 	gen_require(`
1ee0a31
-		attribute_role vpnc_roles;
1ee0a31
+		#attribute_role vpnc_roles;
1ee0a31
+		type vpnc_t;
1ee0a31
 	')
1ee0a31
 
1ee0a31
+	#vpn_domtrans($1)
1ee0a31
+	#roleattribute $2 vpnc_roles;
1ee0a31
+
1ee0a31
 	vpn_domtrans($1)
1ee0a31
-	roleattribute $2 vpnc_roles;
1ee0a31
+        role $2 types vpnc_t;
1ee0a31
+        sysnet_run_ifconfig(vpnc_t, $2)
1ee0a31
 ')
1ee0a31
 
1ee0a31
 ########################################
1ee0a31
diff --git a/vpn.te b/vpn.te
1ee0a31
index 99fd457..d2585bb 100644
1ee0a31
--- a/vpn.te
1ee0a31
+++ b/vpn.te
1ee0a31
@@ -5,14 +5,15 @@ policy_module(vpn, 1.15.0)
1ee0a31
 # Declarations
1ee0a31
 #
1ee0a31
 
1ee0a31
-attribute_role vpnc_roles;
1ee0a31
-roleattribute system_r vpnc_roles;
1ee0a31
+#attribute_role vpnc_roles;
1ee0a31
+#roleattribute system_r vpnc_roles;
1ee0a31
 
1ee0a31
 type vpnc_t;
1ee0a31
 type vpnc_exec_t;
1ee0a31
 init_system_domain(vpnc_t, vpnc_exec_t)
1ee0a31
 application_domain(vpnc_t, vpnc_exec_t)
1ee0a31
-role vpnc_roles types vpnc_t;
1ee0a31
+#role vpnc_roles types vpnc_t;
1ee0a31
+role system_r types vpnc_t;
1ee0a31
 
1ee0a31
 type vpnc_tmp_t;
1ee0a31
 files_tmp_file(vpnc_tmp_t)
1ee0a31
@@ -108,7 +109,7 @@ miscfiles_read_localization(vpnc_t)
1ee0a31
 seutil_dontaudit_search_config(vpnc_t)
1ee0a31
 seutil_use_newrole_fds(vpnc_t)
1ee0a31
 
1ee0a31
-sysnet_run_ifconfig(vpnc_t, vpnc_roles)
1ee0a31
+#sysnet_run_ifconfig(vpnc_t, vpnc_roles)
1ee0a31
 sysnet_etc_filetrans_config(vpnc_t)
1ee0a31
 sysnet_manage_config(vpnc_t)
1ee0a31
 
1ee0a31
commit 88b64bdd71ef734271b9370fc37e02785f354f7f
1ee0a31
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a31
Date:   Thu Jun 7 02:33:40 2012 +0200
1ee0a31
1ee0a31
    Fix ncftool.if
1ee0a31
1ee0a31
diff --git a/ncftool.if b/ncftool.if
1ee0a31
index 3a4455f..59f096b 100644
1ee0a31
--- a/ncftool.if
1ee0a31
+++ b/ncftool.if
1ee0a31
@@ -43,11 +43,12 @@ interface(`ncftool_run',`
1ee0a31
         #ncftool_domtrans($1)
1ee0a31
         #roleattribute $2 ncftool_roles;
1ee0a31
 
1ee0a31
-	role $1 types ncftool_t;
1ee0a31
+	ncftool_domtrans($1)
1ee0a31
+        role $2 types ncftool_t;
1ee0a31
 
1ee0a31
-        ncftool_domtrans($2)
1ee0a31
+        optional_policy(`
1ee0a31
+                brctl_run(ncftool_t, $2)
1ee0a31
+        ')
1ee0a31
 
1ee0a31
-        ps_process_pattern($2, ncftool_t)
1ee0a31
-        allow $2 ncftool_t:process signal;
1ee0a31
 ')
1ee0a31
 
1ee0a31
commit 1d49e7e1383a578e75d16b0b7f58dbe25351b1d9
1ee0a31
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a31
Date:   Thu Jun 7 10:47:57 2012 +0200
1ee0a31
1ee0a31
    roleattriburte temp fixes for portage and dpkg
1ee0a31
1ee0a31
diff --git a/dpkg.if b/dpkg.if
1ee0a31
index 4d32b42..d945bd0 100644
1ee0a31
--- a/dpkg.if
1ee0a31
+++ b/dpkg.if
1ee0a31
@@ -62,11 +62,18 @@ interface(`dpkg_domtrans_script',`
1ee0a31
 #
1ee0a31
 interface(`dpkg_run',`
1ee0a31
 	gen_require(`
1ee0a31
-		attribute_role dpkg_roles;
1ee0a31
+		#attribute_role dpkg_roles;
1ee0a31
+		type dpkg_t, dpkg_script_t		
1ee0a31
 	')
1ee0a31
 
1ee0a31
+	#dpkg_domtrans($1)
1ee0a31
+	#roleattribute $2 dpkg_roles;
1ee0a31
+
1ee0a31
 	dpkg_domtrans($1)
1ee0a31
-	roleattribute $2 dpkg_roles;
1ee0a31
+        role $2 types dpkg_t;
1ee0a31
+        role $2 types dpkg_script_t;
1ee0a31
+        seutil_run_loadpolicy(dpkg_script_t, $2)
1ee0a31
+
1ee0a31
 ')
1ee0a31
 
1ee0a31
 ########################################
1ee0a31
diff --git a/dpkg.te b/dpkg.te
1ee0a31
index a1b8f92..9ac1b80 100644
1ee0a31
--- a/dpkg.te
1ee0a31
+++ b/dpkg.te
1ee0a31
@@ -5,8 +5,8 @@ policy_module(dpkg, 1.9.1)
1ee0a31
 # Declarations
1ee0a31
 #
1ee0a31
 
1ee0a31
-attribute_role dpkg_roles;
1ee0a31
-roleattribute system_r dpkg_roles;
1ee0a31
+#attribute_role dpkg_roles;
1ee0a31
+#roleattribute system_r dpkg_roles;
1ee0a31
 
1ee0a31
 type dpkg_t;
1ee0a31
 type dpkg_exec_t;
1ee0a31
@@ -17,7 +17,8 @@ domain_obj_id_change_exemption(dpkg_t)
1ee0a31
 domain_role_change_exemption(dpkg_t)
1ee0a31
 domain_system_change_exemption(dpkg_t)
1ee0a31
 domain_interactive_fd(dpkg_t)
1ee0a31
-role dpkg_roles types dpkg_t;
1ee0a31
+#role dpkg_roles types dpkg_t;
1ee0a31
+role system_r types dpkg_t;
1ee0a31
 
1ee0a31
 # lockfile
1ee0a31
 type dpkg_lock_t;
1ee0a31
@@ -41,7 +42,8 @@ corecmd_shell_entry_type(dpkg_script_t)
1ee0a31
 domain_obj_id_change_exemption(dpkg_script_t)
1ee0a31
 domain_system_change_exemption(dpkg_script_t)
1ee0a31
 domain_interactive_fd(dpkg_script_t)
1ee0a31
-role dpkg_roles types dpkg_script_t;
1ee0a31
+#role dpkg_roles types dpkg_script_t;
1ee0a31
+role system_r types dpkg_script_t;
1ee0a31
 
1ee0a31
 type dpkg_script_tmp_t;
1ee0a31
 files_tmp_file(dpkg_script_tmp_t)
1ee0a31
@@ -152,9 +154,12 @@ files_exec_etc_files(dpkg_t)
1ee0a31
 init_domtrans_script(dpkg_t)
1ee0a31
 init_use_script_ptys(dpkg_t)
1ee0a31
 
1ee0a31
+#libs_exec_ld_so(dpkg_t)
1ee0a31
+#libs_exec_lib_files(dpkg_t)
1ee0a31
+#libs_run_ldconfig(dpkg_t, dpkg_roles)
1ee0a31
 libs_exec_ld_so(dpkg_t)
1ee0a31
 libs_exec_lib_files(dpkg_t)
1ee0a31
-libs_run_ldconfig(dpkg_t, dpkg_roles)
1ee0a31
+libs_domtrans_ldconfig(dpkg_t)
1ee0a31
 
1ee0a31
 logging_send_syslog_msg(dpkg_t)
1ee0a31
 
1ee0a31
@@ -196,19 +201,30 @@ domain_signull_all_domains(dpkg_t)
1ee0a31
 files_read_etc_runtime_files(dpkg_t)
1ee0a31
 files_exec_usr_files(dpkg_t)
1ee0a31
 miscfiles_read_localization(dpkg_t)
1ee0a31
-modutils_run_depmod(dpkg_t, dpkg_roles)
1ee0a31
-modutils_run_insmod(dpkg_t, dpkg_roles)
1ee0a31
-seutil_run_loadpolicy(dpkg_t, dpkg_roles)
1ee0a31
-seutil_run_setfiles(dpkg_t, dpkg_roles)
1ee0a31
+#modutils_run_depmod(dpkg_t, dpkg_roles)
1ee0a31
+#modutils_run_insmod(dpkg_t, dpkg_roles)
1ee0a31
+#seutil_run_loadpolicy(dpkg_t, dpkg_roles)
1ee0a31
+#seutil_run_setfiles(dpkg_t, dpkg_roles)
1ee0a31
 userdom_use_all_users_fds(dpkg_t)
1ee0a31
 optional_policy(`
1ee0a31
 	mta_send_mail(dpkg_t)
1ee0a31
 ')
1ee0a31
+
1ee0a31
+
1ee0a31
 optional_policy(`
1ee0a31
-	usermanage_run_groupadd(dpkg_t, dpkg_roles)
1ee0a31
-	usermanage_run_useradd(dpkg_t, dpkg_roles)
1ee0a31
+        modutils_domtrans_depmod(dpkg_t)
1ee0a31
+        modutils_domtrans_insmod(dpkg_t)
1ee0a31
+	seutil_domtrans_loadpolicy(dpkg_t)
1ee0a31
+	seutil_domtrans_setfiles(dpkg_t)
1ee0a31
+        usermanage_domtrans_groupadd(dpkg_t)
1ee0a31
+        usermanage_domtrans_useradd(dpkg_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
+#optional_policy(`
1ee0a31
+#	usermanage_run_groupadd(dpkg_t, dpkg_roles)
1ee0a31
+#	usermanage_run_useradd(dpkg_t, dpkg_roles)
1ee0a31
+#')
1ee0a31
+
1ee0a31
 ########################################
1ee0a31
 #
1ee0a31
 # dpkg-script Local policy
1ee0a31
@@ -302,11 +318,11 @@ logging_send_syslog_msg(dpkg_script_t)
1ee0a31
 
1ee0a31
 miscfiles_read_localization(dpkg_script_t)
1ee0a31
 
1ee0a31
-modutils_run_depmod(dpkg_script_t, dpkg_roles)
1ee0a31
-modutils_run_insmod(dpkg_script_t, dpkg_roles)
1ee0a31
+#modutils_run_depmod(dpkg_script_t, dpkg_roles)
1ee0a31
+#modutils_run_insmod(dpkg_script_t, dpkg_roles)
1ee0a31
 
1ee0a31
-seutil_run_loadpolicy(dpkg_script_t, dpkg_roles)
1ee0a31
-seutil_run_setfiles(dpkg_script_t, dpkg_roles)
1ee0a31
+#seutil_run_loadpolicy(dpkg_script_t, dpkg_roles)
1ee0a31
+#seutil_run_setfiles(dpkg_script_t, dpkg_roles)
1ee0a31
 
1ee0a31
 userdom_use_all_users_fds(dpkg_script_t)
1ee0a31
 
1ee0a31
@@ -319,9 +335,9 @@ optional_policy(`
1ee0a31
 	apt_use_fds(dpkg_script_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	bootloader_run(dpkg_script_t, dpkg_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	bootloader_run(dpkg_script_t, dpkg_roles)
1ee0a31
+#')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
 	mta_send_mail(dpkg_script_t)
1ee0a31
@@ -335,7 +351,7 @@ optional_policy(`
1ee0a31
 	unconfined_domain(dpkg_script_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	usermanage_run_groupadd(dpkg_script_t, dpkg_roles)
1ee0a31
-	usermanage_run_useradd(dpkg_script_t, dpkg_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	usermanage_run_groupadd(dpkg_script_t, dpkg_roles)
1ee0a31
+#	usermanage_run_useradd(dpkg_script_t, dpkg_roles)
1ee0a31
+#')
1ee0a31
diff --git a/portage.if b/portage.if
1ee0a31
index b4bb48a..e5e8f12 100644
1ee0a31
--- a/portage.if
1ee0a31
+++ b/portage.if
1ee0a31
@@ -43,11 +43,15 @@ interface(`portage_domtrans',`
1ee0a31
 #
1ee0a31
 interface(`portage_run',`
1ee0a31
 	gen_require(`
1ee0a31
-		attribute_role portage_roles;
1ee0a31
+		type portage_t, portage_fetch_t, portage_sandbox_t;
1ee0a31
+		#attribute_role portage_roles;
1ee0a31
 	')
1ee0a31
 
1ee0a31
-	portage_domtrans($1)
1ee0a31
-	roleattribute $2 portage_roles;
1ee0a31
+	#portage_domtrans($1)
1ee0a31
+	#roleattribute $2 portage_roles;
1ee0a31
+	    portage_domtrans($1)
1ee0a31
+    role $2 types { portage_t portage_fetch_t portage_sandbox_t }
1ee0a31
+
1ee0a31
 ')
1ee0a31
 
1ee0a31
 ########################################
1ee0a31
diff --git a/portage.te b/portage.te
1ee0a31
index 22bdf7d..f726e1d 100644
1ee0a31
--- a/portage.te
1ee0a31
+++ b/portage.te
1ee0a31
@@ -12,7 +12,7 @@ policy_module(portage, 1.12.4)
1ee0a31
 ## </desc>
1ee0a31
 gen_tunable(portage_use_nfs, false)
1ee0a31
 
1ee0a31
-attribute_role portage_roles;
1ee0a31
+#attribute_role portage_roles;
1ee0a31
 
1ee0a31
 type gcc_config_t;
1ee0a31
 type gcc_config_exec_t;
1ee0a31
@@ -25,7 +25,8 @@ application_domain(portage_t, portage_exec_t)
1ee0a31
 domain_obj_id_change_exemption(portage_t)
1ee0a31
 rsync_entry_type(portage_t)
1ee0a31
 corecmd_shell_entry_type(portage_t)
1ee0a31
-role portage_roles types portage_t;
1ee0a31
+#role portage_roles types portage_t;
1ee0a31
+role system_r types portage_t;
1ee0a31
 
1ee0a31
 # portage compile sandbox domain
1ee0a31
 type portage_sandbox_t;
1ee0a31
@@ -33,7 +34,8 @@ application_domain(portage_sandbox_t, portage_exec_t)
1ee0a31
 # the shell is the entrypoint if regular sandbox is disabled
1ee0a31
 # portage_exec_t is the entrypoint if regular sandbox is enabled
1ee0a31
 corecmd_shell_entry_type(portage_sandbox_t)
1ee0a31
-role portage_roles types portage_sandbox_t;
1ee0a31
+#role portage_roles types portage_sandbox_t;
1ee0a31
+role system_r types portage_sandbox_t;
1ee0a31
 
1ee0a31
 # portage package fetching domain
1ee0a31
 type portage_fetch_t;
1ee0a31
@@ -41,7 +43,8 @@ type portage_fetch_exec_t;
1ee0a31
 application_domain(portage_fetch_t, portage_fetch_exec_t)
1ee0a31
 corecmd_shell_entry_type(portage_fetch_t)
1ee0a31
 rsync_entry_type(portage_fetch_t)
1ee0a31
-role portage_roles types portage_fetch_t;
1ee0a31
+#role portage_roles types portage_fetch_t;
1ee0a31
+role system_r types portage_fetch_t;
1ee0a31
 
1ee0a31
 type portage_devpts_t;
1ee0a31
 term_pty(portage_devpts_t)
1ee0a31
@@ -115,7 +118,8 @@ files_list_all(gcc_config_t)
1ee0a31
 init_dontaudit_read_script_status_files(gcc_config_t)
1ee0a31
 
1ee0a31
 libs_read_lib_files(gcc_config_t)
1ee0a31
-libs_run_ldconfig(gcc_config_t, portage_roles)
1ee0a31
+#libs_run_ldconfig(gcc_config_t, portage_roles)
1ee0a31
+libs_domtrans_ldconfig(gcc_config_t)
1ee0a31
 libs_manage_shared_libs(gcc_config_t)
1ee0a31
 # gcc-config creates a temp dir for the libs
1ee0a31
 libs_manage_lib_dirs(gcc_config_t)
1ee0a31
@@ -196,33 +200,41 @@ auth_manage_shadow(portage_t)
1ee0a31
 init_exec(portage_t)
1ee0a31
 
1ee0a31
 # run setfiles -r
1ee0a31
-seutil_run_setfiles(portage_t, portage_roles)
1ee0a31
+#seutil_run_setfiles(portage_t, portage_roles)
1ee0a31
 # run semodule
1ee0a31
-seutil_run_semanage(portage_t, portage_roles)
1ee0a31
+#seutil_run_semanage(portage_t, portage_roles)
1ee0a31
 
1ee0a31
-portage_run_gcc_config(portage_t, portage_roles)
1ee0a31
+#portage_run_gcc_config(portage_t, portage_roles)
1ee0a31
 # if sesandbox is disabled, compiling is performed in this domain
1ee0a31
 portage_compile_domain(portage_t)
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	bootloader_run(portage_t, portage_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	bootloader_run(portage_t, portage_roles)
1ee0a31
+#')
1ee0a31
 
1ee0a31
 optional_policy(`
1ee0a31
 	cron_system_entry(portage_t, portage_exec_t)
1ee0a31
 	cron_system_entry(portage_fetch_t, portage_fetch_exec_t)
1ee0a31
 ')
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	modutils_run_depmod(portage_t, portage_roles)
1ee0a31
-	modutils_run_update_mods(portage_t, portage_roles)
1ee0a31
+#optional_policy(`
1ee0a31
+#	modutils_run_depmod(portage_t, portage_roles)
1ee0a31
+#	modutils_run_update_mods(portage_t, portage_roles)
1ee0a31
 	#dontaudit update_modules_t portage_tmp_t:dir search_dir_perms;
1ee0a31
 ')
1ee0a31
 
1ee0a31
-optional_policy(`
1ee0a31
-	usermanage_run_groupadd(portage_t, portage_roles)
1ee0a31
-	usermanage_run_useradd(portage_t, portage_roles)
1ee0a31
-')
1ee0a31
+#optional_policy(`
1ee0a31
+#	usermanage_run_groupadd(portage_t, portage_roles)
1ee0a31
+#	usermanage_run_useradd(portage_t, portage_roles)
1ee0a31
+#')
1ee0a31
+
1ee0a31
+seutil_domtrans_setfiles(portage_t)
1ee0a31
+seutil_domtrans_semanage(portage_t)
1ee0a31
+bootloader_domtrans(portage_t)
1ee0a31
+modutils_domtrans_depmod(portage_t)
1ee0a31
+modutils_domtrans_update_mods(portage_t)
1ee0a31
+usermanage_domtrans_groupadd(portage_t)
1ee0a31
+usermanage_domtrans_useradd(portage_t)
1ee0a31
 
1ee0a31
 ifdef(`TODO',`
1ee0a31
 # seems to work ok without these
1ee0a31
commit 1797b35f16d5c863a0083148dee4ee3f93c4c4ef
1ee0a31
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a31
Date:   Thu Jun 7 10:52:09 2012 +0200
1ee0a31
1ee0a31
    Fix typo
1ee0a31
1ee0a31
diff --git a/portage.if b/portage.if
1ee0a31
index e5e8f12..7098ded 100644
1ee0a31
--- a/portage.if
1ee0a31
+++ b/portage.if
1ee0a31
@@ -50,7 +50,7 @@ interface(`portage_run',`
1ee0a31
 	#portage_domtrans($1)
1ee0a31
 	#roleattribute $2 portage_roles;
1ee0a31
 	    portage_domtrans($1)
1ee0a31
-    role $2 types { portage_t portage_fetch_t portage_sandbox_t }
1ee0a31
+    role $2 types { portage_t portage_fetch_t portage_sandbox_t };
1ee0a31
 
1ee0a31
 ')
1ee0a31
 
1ee0a31
commit cf999ca29d2a4401c481e28c169e10d676d73526
1ee0a31
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a31
Date:   Thu Jun 7 10:59:22 2012 +0200
1ee0a31
1ee0a31
    One more typo
1ee0a31
1ee0a31
diff --git a/dpkg.if b/dpkg.if
1ee0a31
index d945bd0..78736d8 100644
1ee0a31
--- a/dpkg.if
1ee0a31
+++ b/dpkg.if
1ee0a31
@@ -63,7 +63,7 @@ interface(`dpkg_domtrans_script',`
1ee0a31
 interface(`dpkg_run',`
1ee0a31
 	gen_require(`
1ee0a31
 		#attribute_role dpkg_roles;
1ee0a31
-		type dpkg_t, dpkg_script_t		
1ee0a31
+		type dpkg_t, dpkg_script_t;
1ee0a31
 	')
1ee0a31
 
1ee0a31
 	#dpkg_domtrans($1)