1ee0a3
commit cfa63bfedb3b94a2b78bc3ee394cf7132167e45b
1ee0a3
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a3
Date:   Thu Jun 7 02:18:29 2012 +0200
1ee0a3
1ee0a3
    roleattribute patch
1ee0a3
1ee0a3
diff --git a/policy/modules/admin/bootloader.if b/policy/modules/admin/bootloader.if
1ee0a3
index 4a50807..5e914db 100644
1ee0a3
--- a/policy/modules/admin/bootloader.if
1ee0a3
+++ b/policy/modules/admin/bootloader.if
1ee0a3
@@ -56,11 +56,21 @@ interface(`bootloader_exec',`
1ee0a3
 #
1ee0a3
 interface(`bootloader_run',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role bootloader_roles;
1ee0a3
+		type bootloader_t;
1ee0a3
+		#attribute_role bootloader_roles;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#bootloader_domtrans($1)
1ee0a3
+	#roleattribute $2 bootloader_roles;
1ee0a3
+
1ee0a3
 	bootloader_domtrans($1)
1ee0a3
-	roleattribute $2 bootloader_roles;
1ee0a3
+
1ee0a3
+        role $2 types bootloader_t;
1ee0a3
+
1ee0a3
+        ifdef(`distro_redhat',`
1ee0a3
+                # for mke2fs
1ee0a3
+		mount_run(bootloader_t, $2)
1ee0a3
+	')
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/admin/bootloader.te b/policy/modules/admin/bootloader.te
1ee0a3
index 81a08e4..e717a21 100644
1ee0a3
--- a/policy/modules/admin/bootloader.te
1ee0a3
+++ b/policy/modules/admin/bootloader.te
1ee0a3
@@ -5,8 +5,8 @@ policy_module(bootloader, 1.13.0)
1ee0a3
 # Declarations
1ee0a3
 #
1ee0a3
 
1ee0a3
-attribute_role bootloader_roles;
1ee0a3
-roleattribute system_r bootloader_roles;
1ee0a3
+#attribute_role bootloader_roles;
1ee0a3
+#roleattribute system_r bootloader_roles;
1ee0a3
 
1ee0a3
 #
1ee0a3
 # boot_runtime_t is the type for /boot/kernel.h,
1ee0a3
@@ -19,7 +19,8 @@ files_type(boot_runtime_t)
1ee0a3
 type bootloader_t;
1ee0a3
 type bootloader_exec_t;
1ee0a3
 application_domain(bootloader_t, bootloader_exec_t)
1ee0a3
-role bootloader_roles types bootloader_t;
1ee0a3
+#role bootloader_roles types bootloader_t;
1ee0a3
+role system_r types bootloader_t;
1ee0a3
 
1ee0a3
 #
1ee0a3
 # bootloader_etc_t is the configuration file,
1ee0a3
@@ -174,7 +175,8 @@ ifdef(`distro_redhat',`
1ee0a3
 	files_manage_isid_type_chr_files(bootloader_t)
1ee0a3
 
1ee0a3
 	# for mke2fs
1ee0a3
-	mount_run(bootloader_t, bootloader_roles)
1ee0a3
+	#mount_run(bootloader_t, bootloader_roles)
1ee0a3
+	mount_domtrans(bootloader_t)
1ee0a3
 
1ee0a3
 	optional_policy(`
1ee0a3
 		unconfined_domain(bootloader_t)
1ee0a3
diff --git a/policy/modules/admin/usermanage.if b/policy/modules/admin/usermanage.if
1ee0a3
index 4d387af..764260e 100644
1ee0a3
--- a/policy/modules/admin/usermanage.if
1ee0a3
+++ b/policy/modules/admin/usermanage.if
1ee0a3
@@ -37,11 +37,16 @@ interface(`usermanage_domtrans_chfn',`
1ee0a3
 #
1ee0a3
 interface(`usermanage_run_chfn',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role chfn_roles;
1ee0a3
+		#attribute_role chfn_roles;
1ee0a3
+		type chfn_t;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#usermanage_domtrans_chfn($1)
1ee0a3
+	#roleattribute $2 chfn_roles;
1ee0a3
+
1ee0a3
 	usermanage_domtrans_chfn($1)
1ee0a3
-	roleattribute $2 chfn_roles;
1ee0a3
+        role $2 types chfn_t;
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
@@ -101,11 +106,19 @@ interface(`usermanage_access_check_groupadd',`
1ee0a3
 #
1ee0a3
 interface(`usermanage_run_groupadd',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role groupadd_roles;
1ee0a3
+		type groupadd_t;
1ee0a3
+		#attribute_role groupadd_roles;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#usermanage_domtrans_groupadd($1)
1ee0a3
+	#roleattribute $2 groupadd_roles;
1ee0a3
 	usermanage_domtrans_groupadd($1)
1ee0a3
-	roleattribute $2 groupadd_roles;
1ee0a3
+        role $2 types groupadd_t;
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                nscd_run(groupadd_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
@@ -163,11 +176,17 @@ interface(`usermanage_kill_passwd',`
1ee0a3
 #
1ee0a3
 interface(`usermanage_run_passwd',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role passwd_roles;
1ee0a3
+		type type passwd_t;
1ee0a3
+		#attribute_role passwd_roles;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#usermanage_domtrans_passwd($1)
1ee0a3
+	#roleattribute $2 passwd_roles;
1ee0a3
+
1ee0a3
 	usermanage_domtrans_passwd($1)
1ee0a3
-	roleattribute $2 passwd_roles;
1ee0a3
+        role $2 types passwd_t;
1ee0a3
+        auth_run_chk_passwd(passwd_t, $2)
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
@@ -229,11 +248,20 @@ interface(`usermanage_domtrans_admin_passwd',`
1ee0a3
 #
1ee0a3
 interface(`usermanage_run_admin_passwd',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role sysadm_passwd_roles;
1ee0a3
+		type sysadm_passwd_t;
1ee0a3
+		#attribute_role sysadm_passwd_roles;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#usermanage_domtrans_admin_passwd($1)
1ee0a3
+	#roleattribute $2 sysadm_passwd_roles;
1ee0a3
+
1ee0a3
 	usermanage_domtrans_admin_passwd($1)
1ee0a3
-	roleattribute $2 sysadm_passwd_roles;
1ee0a3
+        role $2 types sysadm_passwd_t;
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                nscd_run(sysadm_passwd_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
@@ -292,11 +320,20 @@ interface(`usermanage_domtrans_useradd',`
1ee0a3
 #
1ee0a3
 interface(`usermanage_run_useradd',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role useradd_roles;
1ee0a3
+		#attribute_role useradd_roles;
1ee0a3
+		type sysadm_passwd_t;
1ee0a3
 	')
1ee0a3
 
1ee0a3
-	usermanage_domtrans_useradd($1)
1ee0a3
-	roleattribute $2 useradd_roles;
1ee0a3
+	#usermanage_domtrans_useradd($1)
1ee0a3
+	#roleattribute $2 useradd_roles;
1ee0a3
+
1ee0a3
+	usermanage_domtrans_admin_passwd($1)
1ee0a3
+        role $2 types sysadm_passwd_t;
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                nscd_run(sysadm_passwd_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/admin/usermanage.te b/policy/modules/admin/usermanage.te
1ee0a3
index 446b743..a077b28 100644
1ee0a3
--- a/policy/modules/admin/usermanage.te
1ee0a3
+++ b/policy/modules/admin/usermanage.te
1ee0a3
@@ -5,18 +5,18 @@ policy_module(usermanage, 1.17.3)
1ee0a3
 # Declarations
1ee0a3
 #
1ee0a3
 
1ee0a3
-attribute_role chfn_roles;
1ee0a3
-role system_r types chfn_t;
1ee0a3
+#attribute_role chfn_roles;
1ee0a3
+#role system_r types chfn_t;
1ee0a3
 
1ee0a3
-attribute_role groupadd_roles;
1ee0a3
+#attribute_role groupadd_roles;
1ee0a3
 
1ee0a3
-attribute_role passwd_roles;
1ee0a3
-roleattribute system_r passwd_roles;
1ee0a3
+#attribute_role passwd_roles;
1ee0a3
+#roleattribute system_r passwd_roles;
1ee0a3
 
1ee0a3
-attribute_role sysadm_passwd_roles;
1ee0a3
-roleattribute system_r sysadm_passwd_roles;
1ee0a3
+#attribute_role sysadm_passwd_roles;
1ee0a3
+#roleattribute system_r sysadm_passwd_roles;
1ee0a3
 
1ee0a3
-attribute_role useradd_roles;
1ee0a3
+#attribute_role useradd_roles;
1ee0a3
 
1ee0a3
 type admin_passwd_exec_t;
1ee0a3
 files_type(admin_passwd_exec_t)
1ee0a3
@@ -25,7 +25,8 @@ type chfn_t;
1ee0a3
 type chfn_exec_t;
1ee0a3
 domain_obj_id_change_exemption(chfn_t)
1ee0a3
 application_domain(chfn_t, chfn_exec_t)
1ee0a3
-role chfn_roles types chfn_t;
1ee0a3
+#role chfn_roles types chfn_t;
1ee0a3
+role system_r types chfn_t;
1ee0a3
 
1ee0a3
 type crack_t;
1ee0a3
 type crack_exec_t;
1ee0a3
@@ -42,18 +43,21 @@ type groupadd_t;
1ee0a3
 type groupadd_exec_t;
1ee0a3
 domain_obj_id_change_exemption(groupadd_t)
1ee0a3
 init_system_domain(groupadd_t, groupadd_exec_t)
1ee0a3
-role groupadd_roles types groupadd_t;
1ee0a3
+#role groupadd_roles types groupadd_t;
1ee0a3
+
1ee0a3
 
1ee0a3
 type passwd_t;
1ee0a3
 type passwd_exec_t;
1ee0a3
 domain_obj_id_change_exemption(passwd_t)
1ee0a3
 application_domain(passwd_t, passwd_exec_t)
1ee0a3
-role passwd_roles types passwd_t;
1ee0a3
+#role passwd_roles types passwd_t;
1ee0a3
+role system_r types passwd_t;
1ee0a3
 
1ee0a3
 type sysadm_passwd_t;
1ee0a3
 domain_obj_id_change_exemption(sysadm_passwd_t)
1ee0a3
 application_domain(sysadm_passwd_t, admin_passwd_exec_t)
1ee0a3
-role sysadm_passwd_roles types sysadm_passwd_t;
1ee0a3
+#role sysadm_passwd_roles types sysadm_passwd_t;
1ee0a3
+role system_r types sysadm_passwd_t;
1ee0a3
 
1ee0a3
 type sysadm_passwd_tmp_t;
1ee0a3
 files_tmp_file(sysadm_passwd_tmp_t)
1ee0a3
@@ -62,7 +66,8 @@ type useradd_t;
1ee0a3
 type useradd_exec_t;
1ee0a3
 domain_obj_id_change_exemption(useradd_t)
1ee0a3
 init_system_domain(useradd_t, useradd_exec_t)
1ee0a3
-role useradd_roles types useradd_t;
1ee0a3
+#role useradd_roles types useradd_t;
1ee0a3
+role system_r types useradd_t;
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
 #
1ee0a3
@@ -106,11 +111,11 @@ fs_search_auto_mountpoints(chfn_t)
1ee0a3
 dev_read_urand(chfn_t)
1ee0a3
 dev_dontaudit_getattr_all(chfn_t)
1ee0a3
 
1ee0a3
-#auth_manage_passwd(chfn_t)
1ee0a3
-#auth_use_pam(chfn_t)
1ee0a3
-auth_run_chk_passwd(chfn_t, chfn_roles)
1ee0a3
-auth_dontaudit_read_shadow(chfn_t)
1ee0a3
-auth_use_nsswitch(chfn_t)
1ee0a3
+auth_manage_passwd(chfn_t)
1ee0a3
+auth_use_pam(chfn_t)
1ee0a3
+#auth_run_chk_passwd(chfn_t, chfn_roles)
1ee0a3
+#auth_dontaudit_read_shadow(chfn_t)
1ee0a3
+#auth_use_nsswitch(chfn_t)
1ee0a3
 
1ee0a3
 # allow checking if a shell is executable
1ee0a3
 corecmd_check_exec_shell(chfn_t)
1ee0a3
@@ -250,7 +255,8 @@ logging_send_syslog_msg(groupadd_t)
1ee0a3
 
1ee0a3
 miscfiles_read_localization(groupadd_t)
1ee0a3
 
1ee0a3
-auth_run_chk_passwd(groupadd_t, groupadd_roles)
1ee0a3
+#auth_run_chk_passwd(groupadd_t, groupadd_roles)
1ee0a3
+auth_domtrans_chk_passwd(groupadd_t)
1ee0a3
 auth_rw_lastlog(groupadd_t)
1ee0a3
 auth_use_nsswitch(groupadd_t)
1ee0a3
 auth_manage_passwd(groupadd_t)
1ee0a3
@@ -273,7 +279,8 @@ optional_policy(`
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
-	nscd_run(groupadd_t, groupadd_roles)
1ee0a3
+#	nscd_run(groupadd_t, groupadd_roles)
1ee0a3
+	nscd_domtrans(groupadd_t)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
@@ -332,18 +339,18 @@ selinux_compute_user_contexts(passwd_t)
1ee0a3
 term_use_all_inherited_terms(passwd_t)
1ee0a3
 term_getattr_all_ptys(passwd_t)
1ee0a3
 
1ee0a3
-#auth_manage_passwd(passwd_t)
1ee0a3
-#auth_manage_shadow(passwd_t)
1ee0a3
-#auth_relabel_shadow(passwd_t)
1ee0a3
-#auth_etc_filetrans_shadow(passwd_t)
1ee0a3
-#auth_use_pam(passwd_t)
1ee0a3
-
1ee0a3
-auth_run_chk_passwd(passwd_t, passwd_roles)
1ee0a3
 auth_manage_passwd(passwd_t)
1ee0a3
 auth_manage_shadow(passwd_t)
1ee0a3
 auth_relabel_shadow(passwd_t)
1ee0a3
 auth_etc_filetrans_shadow(passwd_t)
1ee0a3
-auth_use_nsswitch(passwd_t)
1ee0a3
+auth_use_pam(passwd_t)
1ee0a3
+
1ee0a3
+#auth_run_chk_passwd(passwd_t, passwd_roles)
1ee0a3
+#auth_manage_passwd(passwd_t)
1ee0a3
+#auth_manage_shadow(passwd_t)
1ee0a3
+#auth_relabel_shadow(passwd_t)
1ee0a3
+#auth_etc_filetrans_shadow(passwd_t)
1ee0a3
+#auth_use_nsswitch(passwd_t)
1ee0a3
 
1ee0a3
 # allow checking if a shell is executable
1ee0a3
 corecmd_check_exec_shell(passwd_t)
1ee0a3
@@ -385,7 +392,8 @@ userdom_dontaudit_search_user_home_content(passwd_t)
1ee0a3
 userdom_stream_connect(passwd_t)
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
-	nscd_run(passwd_t, passwd_roles)
1ee0a3
+	#nscd_run(passwd_t, passwd_roles)
1ee0a3
+	nscd_domtrans(passwd_t)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
@@ -469,7 +477,8 @@ userdom_use_unpriv_users_fds(sysadm_passwd_t)
1ee0a3
 userdom_dontaudit_search_user_home_content(sysadm_passwd_t)
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
-	nscd_run(sysadm_passwd_t, sysadm_passwd_roles)
1ee0a3
+	nscd_domtrans(sysadm_passwd_t)
1ee0a3
+	#nscd_run(sysadm_passwd_t, sysadm_passwd_roles)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
@@ -525,7 +534,8 @@ seutil_manage_default_contexts(useradd_t)
1ee0a3
 term_use_all_inherited_terms(useradd_t)
1ee0a3
 term_getattr_all_ptys(useradd_t)
1ee0a3
 
1ee0a3
-auth_run_chk_passwd(useradd_t, useradd_roles)
1ee0a3
+#auth_run_chk_passwd(useradd_t, useradd_roles)
1ee0a3
+auth_domtrans_chk_passwd(useradd_t)
1ee0a3
 auth_rw_lastlog(useradd_t)
1ee0a3
 auth_rw_faillog(useradd_t)
1ee0a3
 auth_use_nsswitch(useradd_t)
1ee0a3
@@ -547,15 +557,15 @@ miscfiles_read_localization(useradd_t)
1ee0a3
 seutil_read_config(useradd_t)
1ee0a3
 seutil_read_file_contexts(useradd_t)
1ee0a3
 seutil_read_default_contexts(useradd_t)
1ee0a3
-#seutil_domtrans_semanage(useradd_t)
1ee0a3
-#seutil_domtrans_setfiles(useradd_t)
1ee0a3
-#seutil_domtrans_loadpolicy(useradd_t)
1ee0a3
-#seutil_manage_bin_policy(useradd_t)
1ee0a3
-#seutil_manage_module_store(useradd_t)
1ee0a3
-#seutil_get_semanage_trans_lock(useradd_t)
1ee0a3
-#seutil_get_semanage_read_lock(useradd_t)
1ee0a3
-seutil_run_semanage(useradd_t, useradd_roles)
1ee0a3
-seutil_run_setfiles(useradd_t, useradd_roles)
1ee0a3
+seutil_domtrans_semanage(useradd_t)
1ee0a3
+seutil_domtrans_setfiles(useradd_t)
1ee0a3
+seutil_domtrans_loadpolicy(useradd_t)
1ee0a3
+seutil_manage_bin_policy(useradd_t)
1ee0a3
+seutil_manage_module_store(useradd_t)
1ee0a3
+seutil_get_semanage_trans_lock(useradd_t)
1ee0a3
+seutil_get_semanage_read_lock(useradd_t)
1ee0a3
+#seutil_run_semanage(useradd_t, useradd_roles)
1ee0a3
+#seutil_run_setfiles(useradd_t, useradd_roles)
1ee0a3
 
1ee0a3
 userdom_use_unpriv_users_fds(useradd_t)
1ee0a3
 # Add/remove user home directories
1ee0a3
@@ -576,7 +586,8 @@ optional_policy(`
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
-	nscd_run(useradd_t, useradd_roles)
1ee0a3
+	nscd_domtrans(useradd_t)
1ee0a3
+#	nscd_run(useradd_t, useradd_roles)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
diff --git a/policy/modules/system/iptables.if b/policy/modules/system/iptables.if
1ee0a3
index 174cfdb..7071460 100644
1ee0a3
--- a/policy/modules/system/iptables.if
1ee0a3
+++ b/policy/modules/system/iptables.if
1ee0a3
@@ -38,11 +38,22 @@ interface(`iptables_domtrans',`
1ee0a3
 #
1ee0a3
 interface(`iptables_run',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role iptables_roles;
1ee0a3
+		#attribute_role iptables_roles;
1ee0a3
+		type iptables_t;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#iptables_domtrans($1)
1ee0a3
+	#roleattribute $2 iptables_roles;
1ee0a3
+
1ee0a3
 	iptables_domtrans($1)
1ee0a3
-	roleattribute $2 iptables_roles;
1ee0a3
+        role $2 types iptables_t;
1ee0a3
+
1ee0a3
+        sysnet_run_ifconfig(iptables_t, $2)
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                modutils_run_insmod(iptables_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/system/iptables.te b/policy/modules/system/iptables.te
1ee0a3
index cc8d773..36e02fa 100644
1ee0a3
--- a/policy/modules/system/iptables.te
1ee0a3
+++ b/policy/modules/system/iptables.te
1ee0a3
@@ -5,13 +5,14 @@ policy_module(iptables, 1.13.0)
1ee0a3
 # Declarations
1ee0a3
 #
1ee0a3
 
1ee0a3
-attribute_role iptables_roles;
1ee0a3
-roleattribute system_r iptables_roles;
1ee0a3
+#attribute_role iptables_roles;
1ee0a3
+#roleattribute system_r iptables_roles;
1ee0a3
 
1ee0a3
 type iptables_t;
1ee0a3
 type iptables_exec_t;
1ee0a3
 init_system_domain(iptables_t, iptables_exec_t)
1ee0a3
-role iptables_roles types iptables_t;
1ee0a3
+#role iptables_roles types iptables_t;
1ee0a3
+role system_r types iptables_t;
1ee0a3
 
1ee0a3
 type iptables_initrc_exec_t;
1ee0a3
 init_script_file(iptables_initrc_exec_t)
1ee0a3
@@ -97,7 +98,8 @@ logging_send_syslog_msg(iptables_t)
1ee0a3
 
1ee0a3
 miscfiles_read_localization(iptables_t)
1ee0a3
 
1ee0a3
-sysnet_run_ifconfig(iptables_t, iptables_roles)
1ee0a3
+#sysnet_run_ifconfig(iptables_t, iptables_roles)
1ee0a3
+sysnet_domtrans_ifconfig(iptables_t)
1ee0a3
 sysnet_dns_name_resolve(iptables_t)
1ee0a3
 
1ee0a3
 userdom_use_inherited_user_terminals(iptables_t)
1ee0a3
@@ -119,7 +121,8 @@ optional_policy(`
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
-	modutils_run_insmod(iptables_t, iptables_roles)
1ee0a3
+	modutils_domtrans_insmod(iptables_t)
1ee0a3
+	#modutils_run_insmod(iptables_t, iptables_roles)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
diff --git a/policy/modules/system/modutils.if b/policy/modules/system/modutils.if
1ee0a3
index 786f87a..2debedc 100644
1ee0a3
--- a/policy/modules/system/modutils.if
1ee0a3
+++ b/policy/modules/system/modutils.if
1ee0a3
@@ -345,11 +345,18 @@ interface(`modutils_domtrans_update_mods',`
1ee0a3
 #
1ee0a3
 interface(`modutils_run_update_mods',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role update_modules_roles;
1ee0a3
+		#attribute_role update_modules_roles;
1ee0a3
+		type update_modules_t;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#modutils_domtrans_update_mods($1)
1ee0a3
+	#roleattribute $2 update_modules_roles;
1ee0a3
+
1ee0a3
 	modutils_domtrans_update_mods($1)
1ee0a3
-	roleattribute $2 update_modules_roles;
1ee0a3
+	role $2 types update_modules_t;
1ee0a3
+
1ee0a3
+	modutils_run_insmod(update_modules_t, $2)
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/system/modutils.te b/policy/modules/system/modutils.te
1ee0a3
index b83608d..86a7107 100644
1ee0a3
--- a/policy/modules/system/modutils.te
1ee0a3
+++ b/policy/modules/system/modutils.te
1ee0a3
@@ -5,7 +5,7 @@ policy_module(modutils, 1.12.1)
1ee0a3
 # Declarations
1ee0a3
 #
1ee0a3
 
1ee0a3
-attribute_role update_modules_roles;
1ee0a3
+#attribute_role update_modules_roles;
1ee0a3
 
1ee0a3
 type depmod_t;
1ee0a3
 type depmod_exec_t;
1ee0a3
@@ -30,8 +30,9 @@ files_type(modules_dep_t)
1ee0a3
 type update_modules_t;
1ee0a3
 type update_modules_exec_t;
1ee0a3
 init_system_domain(update_modules_t, update_modules_exec_t)
1ee0a3
-roleattribute system_r update_modules_roles;
1ee0a3
-role update_modules_roles types update_modules_t;
1ee0a3
+#roleattribute system_r update_modules_roles;
1ee0a3
+#role update_modules_roles types update_modules_t;
1ee0a3
+role system_r types update_modules_t;
1ee0a3
 
1ee0a3
 type update_modules_tmp_t;
1ee0a3
 files_tmp_file(update_modules_tmp_t)
1ee0a3
@@ -318,7 +319,7 @@ logging_send_syslog_msg(update_modules_t)
1ee0a3
 
1ee0a3
 miscfiles_read_localization(update_modules_t)
1ee0a3
 
1ee0a3
-modutils_run_insmod(update_modules_t, update_modules_roles)
1ee0a3
+#modutils_run_insmod(update_modules_t, update_modules_roles)
1ee0a3
 
1ee0a3
 userdom_use_inherited_user_terminals(update_modules_t)
1ee0a3
 userdom_dontaudit_search_user_home_dirs(update_modules_t)
1ee0a3
diff --git a/policy/modules/system/mount.if b/policy/modules/system/mount.if
1ee0a3
index 52e78b8..4881d86 100644
1ee0a3
--- a/policy/modules/system/mount.if
1ee0a3
+++ b/policy/modules/system/mount.if
1ee0a3
@@ -44,11 +44,36 @@ interface(`mount_domtrans',`
1ee0a3
 #
1ee0a3
 interface(`mount_run',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role mount_roles;
1ee0a3
+		#attribute_role mount_roles;
1ee0a3
+		type mount_t;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#mount_domtrans($1)
1ee0a3
+	#roleattribute $2 mount_roles;
1ee0a3
+
1ee0a3
 	mount_domtrans($1)
1ee0a3
-	roleattribute $2 mount_roles;
1ee0a3
+        role $2 types mount_t;
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                fstools_run(mount_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+	optional_policy(`
1ee0a3
+                lvm_run(mount_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                modutils_run_insmod(mount_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                rpc_run_rpcd(mount_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                samba_run_smbmount(mount_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/system/mount.te b/policy/modules/system/mount.te
1ee0a3
index cc76452..14320fe 100644
1ee0a3
--- a/policy/modules/system/mount.te
1ee0a3
+++ b/policy/modules/system/mount.te
1ee0a3
@@ -12,13 +12,14 @@ policy_module(mount, 1.14.2)
1ee0a3
 ## </desc>
1ee0a3
 gen_tunable(allow_mount_anyfile, false)
1ee0a3
 
1ee0a3
-attribute_role mount_roles;
1ee0a3
-roleattribute system_r mount_roles;
1ee0a3
+#attribute_role mount_roles;
1ee0a3
+#roleattribute system_r mount_roles;
1ee0a3
 
1ee0a3
 type mount_t;
1ee0a3
 type mount_exec_t;
1ee0a3
 init_system_domain(mount_t, mount_exec_t)
1ee0a3
-role mount_roles types mount_t;
1ee0a3
+#role mount_roles types mount_t;
1ee0a3
+role system_r types mount_t;
1ee0a3
 
1ee0a3
 type fusermount_exec_t;
1ee0a3
 domain_entry_file(mount_t, fusermount_exec_t)
1ee0a3
@@ -286,25 +287,28 @@ optional_policy(`
1ee0a3
 
1ee0a3
 # Needed for mount crypt https://bugzilla.redhat.com/show_bug.cgi?id=418711
1ee0a3
 optional_policy(`
1ee0a3
-	lvm_run(mount_t, mount_roles)
1ee0a3
+#	lvm_run(mount_t, mount_roles)
1ee0a3
+	lvm_domtrans(mount_t)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
-	modutils_run_insmod(mount_t, mount_roles)
1ee0a3
+	#modutils_run_insmod(mount_t, mount_roles)
1ee0a3
+	modutils_domtrans_insmod(mount_t)
1ee0a3
 	modutils_read_module_deps(mount_t)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
-	fstools_run(mount_t, mount_roles)
1ee0a3
+	fstools_domtrans(mount_t)
1ee0a3
+	#fstools_run(mount_t, mount_roles)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
 	rhcs_stream_connect_gfs_controld(mount_t)
1ee0a3
 ')
1ee0a3
 
1ee0a3
-optional_policy(`
1ee0a3
-	rpc_run_rpcd(mount_t, mount_roles)
1ee0a3
-')
1ee0a3
+#optional_policy(`
1ee0a3
+#	rpc_run_rpcd(mount_t, mount_roles)
1ee0a3
+#')
1ee0a3
 
1ee0a3
 # for kernel package installation
1ee0a3
 optional_policy(`
1ee0a3
@@ -314,7 +318,8 @@ optional_policy(`
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
 	samba_read_config(mount_t)
1ee0a3
-	samba_run_smbmount(mount_t, mount_roles)
1ee0a3
+	samba_domtrans_smbmount(mount_t)
1ee0a3
+	#samba_run_smbmount(mount_t, mount_roles)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
diff --git a/policy/modules/system/selinuxutil.if b/policy/modules/system/selinuxutil.if
1ee0a3
index a853819..cebf588 100644
1ee0a3
--- a/policy/modules/system/selinuxutil.if
1ee0a3
+++ b/policy/modules/system/selinuxutil.if
1ee0a3
@@ -192,11 +192,22 @@ interface(`seutil_domtrans_newrole',`
1ee0a3
 #
1ee0a3
 interface(`seutil_run_newrole',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role newrole_roles;
1ee0a3
+		type newrole_t;
1ee0a3
+		#attribute_role newrole_roles;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#seutil_domtrans_newrole($1)
1ee0a3
+	#roleattribute $2 newrole_roles;
1ee0a3
+
1ee0a3
 	seutil_domtrans_newrole($1)
1ee0a3
-	roleattribute $2 newrole_roles;
1ee0a3
+        role $2 types newrole_t;
1ee0a3
+
1ee0a3
+        auth_run_upd_passwd(newrole_t, $2)
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                namespace_init_run(newrole_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te
1ee0a3
index 2aee0c0..4c24e3e 100644
1ee0a3
--- a/policy/modules/system/selinuxutil.te
1ee0a3
+++ b/policy/modules/system/selinuxutil.te
1ee0a3
@@ -14,7 +14,7 @@ attribute can_relabelto_binary_policy;
1ee0a3
 attribute setfiles_domain;
1ee0a3
 attribute seutil_semanage_domain;
1ee0a3
 
1ee0a3
-attribute_role newrole_roles;
1ee0a3
+#attribute_role newrole_roles;
1ee0a3
 
1ee0a3
 attribute_role run_init_roles;
1ee0a3
 role system_r types run_init_t;
1ee0a3
@@ -65,7 +65,8 @@ application_domain(newrole_t, newrole_exec_t)
1ee0a3
 domain_role_change_exemption(newrole_t)
1ee0a3
 domain_obj_id_change_exemption(newrole_t)
1ee0a3
 domain_interactive_fd(newrole_t)
1ee0a3
-role newrole_roles types newrole_t;
1ee0a3
+#role newrole_roles types newrole_t;
1ee0a3
+role system_r types newrole_t;
1ee0a3
 
1ee0a3
 #
1ee0a3
 # policy_config_t is the type of /etc/security/selinux/*
1ee0a3
@@ -299,10 +300,11 @@ term_relabel_all_ptys(newrole_t)
1ee0a3
 term_getattr_unallocated_ttys(newrole_t)
1ee0a3
 term_dontaudit_use_unallocated_ttys(newrole_t)
1ee0a3
 
1ee0a3
-auth_use_nsswitch(newrole_t)
1ee0a3
-auth_run_chk_passwd(newrole_t, newrole_roles)
1ee0a3
-auth_run_upd_passwd(newrole_t, newrole_roles)
1ee0a3
-auth_rw_faillog(newrole_t)
1ee0a3
+#auth_use_nsswitch(newrole_t)
1ee0a3
+#auth_run_chk_passwd(newrole_t, newrole_roles)
1ee0a3
+#auth_run_upd_passwd(newrole_t, newrole_roles)
1ee0a3
+#auth_rw_faillog(newrole_t)
1ee0a3
+auth_use_pam(newrole_t)
1ee0a3
 
1ee0a3
 # Write to utmp.
1ee0a3
 init_rw_utmp(newrole_t)
1ee0a3
@@ -322,9 +324,9 @@ optional_policy(`
1ee0a3
     dbus_system_bus_client(newrole_t)
1ee0a3
 ')
1ee0a3
 
1ee0a3
-optional_policy(`
1ee0a3
-	namespace_init_run(newrole_t, newrole_roles)
1ee0a3
-')
1ee0a3
+#optional_policy(`
1ee0a3
+#	namespace_init_run(newrole_t, newrole_roles)
1ee0a3
+#')
1ee0a3
 
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
diff --git a/policy/modules/system/sysnetwork.if b/policy/modules/system/sysnetwork.if
1ee0a3
index 7b08f77..949fdcc 100644
1ee0a3
--- a/policy/modules/system/sysnetwork.if
1ee0a3
+++ b/policy/modules/system/sysnetwork.if
1ee0a3
@@ -38,11 +38,47 @@ interface(`sysnet_domtrans_dhcpc',`
1ee0a3
 #
1ee0a3
 interface(`sysnet_run_dhcpc',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role dhcpc_roles;
1ee0a3
+		type dhcpc_t;
1ee0a3
+		#attribute_role dhcpc_roles;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#sysnet_domtrans_dhcpc($1)
1ee0a3
+	#roleattribute $2 dhcpc_roles;
1ee0a3
+
1ee0a3
 	sysnet_domtrans_dhcpc($1)
1ee0a3
-	roleattribute $2 dhcpc_roles;
1ee0a3
+        role $2 types dhcpc_t;
1ee0a3
+
1ee0a3
+        modutils_run_insmod(dhcpc_t, $2)
1ee0a3
+
1ee0a3
+        sysnet_run_ifconfig(dhcpc_t, $2)
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                hostname_run(dhcpc_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                netutils_run(dhcpc_t, $2)
1ee0a3
+                netutils_run_ping(dhcpc_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                networkmanager_run(dhcpc_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                nis_run_ypbind(dhcpc_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                nscd_run(dhcpc_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        optional_policy(`
1ee0a3
+                ntp_run(dhcpc_t, $2)
1ee0a3
+        ')
1ee0a3
+
1ee0a3
+        seutil_run_setfiles(dhcpc_t, $2)
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
1ee0a3
index 2d2b6ef..1bfcd4f 100644
1ee0a3
--- a/policy/modules/system/sysnetwork.te
1ee0a3
+++ b/policy/modules/system/sysnetwork.te
1ee0a3
@@ -12,8 +12,8 @@ policy_module(sysnetwork, 1.13.2)
1ee0a3
 ## </desc>
1ee0a3
 gen_tunable(dhcpc_exec_iptables, false)
1ee0a3
 
1ee0a3
-attribute_role dhcpc_roles;
1ee0a3
-roleattribute system_r dhcpc_roles;
1ee0a3
+#attribute_role dhcpc_roles;
1ee0a3
+#roleattribute system_r dhcpc_roles;
1ee0a3
 
1ee0a3
 # this is shared between dhcpc and dhcpd:
1ee0a3
 type dhcp_etc_t;
1ee0a3
@@ -27,7 +27,8 @@ files_type(dhcp_state_t)
1ee0a3
 type dhcpc_t;
1ee0a3
 type dhcpc_exec_t;
1ee0a3
 init_daemon_domain(dhcpc_t, dhcpc_exec_t)
1ee0a3
-role dhcpc_roles types dhcpc_t;
1ee0a3
+#role dhcpc_roles types dhcpc_t;
1ee0a3
+role system_r types dhcpc_t;
1ee0a3
 
1ee0a3
 type dhcpc_helper_exec_t;
1ee0a3
 init_script_file(dhcpc_helper_exec_t)
1ee0a3
@@ -159,9 +160,10 @@ logging_send_syslog_msg(dhcpc_t)
1ee0a3
 miscfiles_read_generic_certs(dhcpc_t)
1ee0a3
 miscfiles_read_localization(dhcpc_t)
1ee0a3
 
1ee0a3
-modutils_run_insmod(dhcpc_t, dhcpc_roles)
1ee0a3
+#modutils_run_insmod(dhcpc_t, dhcpc_roles)
1ee0a3
+modutils_domtrans_insmod(dhcpc_t)
1ee0a3
+#sysnet_run_ifconfig(dhcpc_t, dhcpc_roles)
1ee0a3
 
1ee0a3
-sysnet_run_ifconfig(dhcpc_t, dhcpc_roles)
1ee0a3
 
1ee0a3
 userdom_use_user_terminals(dhcpc_t)
1ee0a3
 userdom_dontaudit_search_user_home_dirs(dhcpc_t)
1ee0a3
@@ -176,9 +178,9 @@ ifdef(`distro_ubuntu',`
1ee0a3
 	')
1ee0a3
 ')
1ee0a3
 
1ee0a3
-optional_policy(`
1ee0a3
-	consoletype_run(dhcpc_t, dhcpc_roles)
1ee0a3
-')
1ee0a3
+#optional_policy(`
1ee0a3
+#	consoletype_run(dhcpc_t, dhcpc_roles)
1ee0a3
+#')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
 	chronyd_initrc_domtrans(dhcpc_t)
1ee0a3
@@ -203,7 +205,8 @@ optional_policy(`
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
-	hostname_run(dhcpc_t, dhcpc_roles)
1ee0a3
+	hostname_domtrans(dhcpc_t)
1ee0a3
+#	hostname_run(dhcpc_t, dhcpc_roles)
1ee0a3
 ')
1ee0a3
 
1ee0a3
 optional_policy(`
1ee0a3
commit 0a0c8b9d35398f3662db1b0bdb2f4c7761121ba1
1ee0a3
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a3
Date:   Thu Jun 7 02:26:53 2012 +0200
1ee0a3
1ee0a3
    roleattribute patch for passwd_t
1ee0a3
1ee0a3
diff --git a/policy/modules/admin/usermanage.if b/policy/modules/admin/usermanage.if
1ee0a3
index 764260e..da75471 100644
1ee0a3
--- a/policy/modules/admin/usermanage.if
1ee0a3
+++ b/policy/modules/admin/usermanage.if
1ee0a3
@@ -176,7 +176,7 @@ interface(`usermanage_kill_passwd',`
1ee0a3
 #
1ee0a3
 interface(`usermanage_run_passwd',`
1ee0a3
 	gen_require(`
1ee0a3
-		type type passwd_t;
1ee0a3
+		type passwd_t;
1ee0a3
 		#attribute_role passwd_roles;
1ee0a3
 	')
1ee0a3
 
1ee0a3
commit 0b71245f63ddbb6ca00790fa5318db798286d8d8
1ee0a3
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a3
Date:   Thu Jun 7 02:38:28 2012 +0200
1ee0a3
1ee0a3
    Fix also for sysnetwork.te
1ee0a3
1ee0a3
diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
1ee0a3
index 1bfcd4f..3a94d52 100644
1ee0a3
--- a/policy/modules/system/sysnetwork.te
1ee0a3
+++ b/policy/modules/system/sysnetwork.te
1ee0a3
@@ -226,8 +226,10 @@ optional_policy(`
1ee0a3
 
1ee0a3
 # for the dhcp client to run ping to check IP addresses
1ee0a3
 optional_policy(`
1ee0a3
-	netutils_run_ping(dhcpc_t, dhcpc_roles)
1ee0a3
-	netutils_run(dhcpc_t, dhcpc_roles)
1ee0a3
+	#netutils_run_ping(dhcpc_t, dhcpc_roles)
1ee0a3
+	#netutils_run(dhcpc_t, dhcpc_roles)
1ee0a3
+	netutils_domtrans_ping(dhcpc_t)
1ee0a3
+        netutils_domtrans(dhcpc_t
1ee0a3
 ',`
1ee0a3
 	allow dhcpc_t self:capability setuid;
1ee0a3
 	allow dhcpc_t self:rawip_socket create_socket_perms;
1ee0a3
commit fdfc3cf8dbc69bda177afe16e78a52891cb6da4a
1ee0a3
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a3
Date:   Thu Jun 7 02:41:48 2012 +0200
1ee0a3
1ee0a3
    Other
1ee0a3
1ee0a3
diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
1ee0a3
index 3a94d52..6a6f03f 100644
1ee0a3
--- a/policy/modules/system/sysnetwork.te
1ee0a3
+++ b/policy/modules/system/sysnetwork.te
1ee0a3
@@ -229,7 +229,7 @@ optional_policy(`
1ee0a3
 	#netutils_run_ping(dhcpc_t, dhcpc_roles)
1ee0a3
 	#netutils_run(dhcpc_t, dhcpc_roles)
1ee0a3
 	netutils_domtrans_ping(dhcpc_t)
1ee0a3
-        netutils_domtrans(dhcpc_t
1ee0a3
+        netutils_domtrans(dhcpc_t)
1ee0a3
 ',`
1ee0a3
 	allow dhcpc_t self:capability setuid;
1ee0a3
 	allow dhcpc_t self:rawip_socket create_socket_perms;
1ee0a3
commit 2ea19d46d563741f998001a38f9d4dbb4d1fdd06
1ee0a3
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a3
Date:   Thu Jun 7 08:10:01 2012 +0200
1ee0a3
1ee0a3
    Fix passwd
1ee0a3
1ee0a3
diff --git a/policy/modules/admin/usermanage.te b/policy/modules/admin/usermanage.te
1ee0a3
index a077b28..396909c 100644
1ee0a3
--- a/policy/modules/admin/usermanage.te
1ee0a3
+++ b/policy/modules/admin/usermanage.te
1ee0a3
@@ -526,11 +526,6 @@ fs_getattr_xattr_fs(useradd_t)
1ee0a3
 mls_file_upgrade(useradd_t)
1ee0a3
 mls_process_read_to_clearance(useradd_t)
1ee0a3
 
1ee0a3
-seutil_semanage_policy(useradd_t)
1ee0a3
-seutil_manage_file_contexts(useradd_t)
1ee0a3
-seutil_manage_config(useradd_t)
1ee0a3
-seutil_manage_default_contexts(useradd_t)
1ee0a3
-
1ee0a3
 term_use_all_inherited_terms(useradd_t)
1ee0a3
 term_getattr_all_ptys(useradd_t)
1ee0a3
 
1ee0a3
@@ -554,14 +549,19 @@ logging_send_syslog_msg(useradd_t)
1ee0a3
 
1ee0a3
 miscfiles_read_localization(useradd_t)
1ee0a3
 
1ee0a3
+seutil_semanage_policy(useradd_t)
1ee0a3
+seutil_manage_file_contexts(useradd_t)
1ee0a3
+seutil_manage_config(useradd_t)
1ee0a3
+seutil_manage_default_contexts(useradd_t)
1ee0a3
+
1ee0a3
 seutil_read_config(useradd_t)
1ee0a3
 seutil_read_file_contexts(useradd_t)
1ee0a3
 seutil_read_default_contexts(useradd_t)
1ee0a3
 seutil_domtrans_semanage(useradd_t)
1ee0a3
 seutil_domtrans_setfiles(useradd_t)
1ee0a3
 seutil_domtrans_loadpolicy(useradd_t)
1ee0a3
-seutil_manage_bin_policy(useradd_t)
1ee0a3
-seutil_manage_module_store(useradd_t)
1ee0a3
+#seutil_manage_bin_policy(useradd_t)
1ee0a3
+#seutil_manage_module_store(useradd_t)
1ee0a3
 seutil_get_semanage_trans_lock(useradd_t)
1ee0a3
 seutil_get_semanage_read_lock(useradd_t)
1ee0a3
 #seutil_run_semanage(useradd_t, useradd_roles)
1ee0a3
commit db92f5bcb6fe7f86aae12dffe64ec3d920815343
1ee0a3
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a3
Date:   Thu Jun 7 08:30:34 2012 +0200
1ee0a3
1ee0a3
    Also for semanage_roles
1ee0a3
1ee0a3
diff --git a/policy/modules/system/selinuxutil.if b/policy/modules/system/selinuxutil.if
1ee0a3
index cebf588..7e38077 100644
1ee0a3
--- a/policy/modules/system/selinuxutil.if
1ee0a3
+++ b/policy/modules/system/selinuxutil.if
1ee0a3
@@ -1140,11 +1140,18 @@ interface(`seutil_domtrans_setsebool',`
1ee0a3
 #
1ee0a3
 interface(`seutil_run_semanage',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role semanage_roles;
1ee0a3
+		#attribute_role semanage_roles;
1ee0a3
+		type semanage_t;
1ee0a3
 	')
1ee0a3
 
1ee0a3
+	#seutil_domtrans_semanage($1)
1ee0a3
+	#roleattribute $2 semanage_roles;
1ee0a3
+
1ee0a3
 	seutil_domtrans_semanage($1)
1ee0a3
-	roleattribute $2 semanage_roles;
1ee0a3
+        seutil_run_setfiles(semanage_t, $2)
1ee0a3
+        seutil_run_loadpolicy(semanage_t, $2)
1ee0a3
+        role $2 types semanage_t;
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te
1ee0a3
index 4c24e3e..90498cd 100644
1ee0a3
--- a/policy/modules/system/selinuxutil.te
1ee0a3
+++ b/policy/modules/system/selinuxutil.te
1ee0a3
@@ -19,8 +19,8 @@ attribute seutil_semanage_domain;
1ee0a3
 attribute_role run_init_roles;
1ee0a3
 role system_r types run_init_t;
1ee0a3
 
1ee0a3
-attribute_role semanage_roles;
1ee0a3
-roleattribute system_r semanage_roles;
1ee0a3
+#attribute_role semanage_roles;
1ee0a3
+#roleattribute system_r semanage_roles;
1ee0a3
 
1ee0a3
 #
1ee0a3
 # selinux_config_t is the type applied to
1ee0a3
@@ -110,7 +110,8 @@ application_domain(semanage_t, semanage_exec_t)
1ee0a3
 dbus_system_domain(semanage_t, semanage_exec_t)
1ee0a3
 init_daemon_domain(semanage_t, semanage_exec_t)
1ee0a3
 domain_interactive_fd(semanage_t)
1ee0a3
-role semanage_roles types semanage_t;
1ee0a3
+#role semanage_roles types semanage_t;
1ee0a3
+role system_r types semanage_t;
1ee0a3
 
1ee0a3
 type setsebool_t;
1ee0a3
 type setsebool_exec_t;
1ee0a3
@@ -530,14 +531,15 @@ files_read_non_security_files(semanage_t)
1ee0a3
 
1ee0a3
 seutil_manage_file_contexts(semanage_t)
1ee0a3
 seutil_manage_config(semanage_t)
1ee0a3
-
1ee0a3
-seutil_run_setfiles(semanage_t, semanage_roles)
1ee0a3
-seutil_run_loadpolicy(semanage_t, semanage_roles)
1ee0a3
-seutil_manage_bin_policy(semanage_t)
1ee0a3
-seutil_use_newrole_fds(semanage_t)
1ee0a3
-seutil_manage_module_store(semanage_t)
1ee0a3
-seutil_get_semanage_trans_lock(semanage_t)
1ee0a3
-seutil_get_semanage_read_lock(semanage_t)
1ee0a3
+seutil_domtrans_setfiles(semanage_t)
1ee0a3
+
1ee0a3
+#seutil_run_setfiles(semanage_t, semanage_roles)
1ee0a3
+#seutil_run_loadpolicy(semanage_t, semanage_roles)
1ee0a3
+#seutil_manage_bin_policy(semanage_t)
1ee0a3
+#seutil_use_newrole_fds(semanage_t)
1ee0a3
+#seutil_manage_module_store(semanage_t)
1ee0a3
+#seutil_get_semanage_trans_lock(semanage_t)
1ee0a3
+#seutil_get_semanage_read_lock(semanage_t)
1ee0a3
 # netfilter_contexts:
1ee0a3
 seutil_manage_default_contexts(semanage_t)
1ee0a3
 
1ee0a3
commit aebf9204ec2a7cfb943327eb3aace2a9b4130769
1ee0a3
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a3
Date:   Thu Jun 7 08:38:22 2012 +0200
1ee0a3
1ee0a3
    run_init roles
1ee0a3
1ee0a3
diff --git a/policy/modules/system/selinuxutil.if b/policy/modules/system/selinuxutil.if
1ee0a3
index 7e38077..6903c5e 100644
1ee0a3
--- a/policy/modules/system/selinuxutil.if
1ee0a3
+++ b/policy/modules/system/selinuxutil.if
1ee0a3
@@ -457,11 +457,20 @@ interface(`seutil_init_script_domtrans_runinit',`
1ee0a3
 #
1ee0a3
 interface(`seutil_run_runinit',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role run_init_roles;
1ee0a3
+		#attribute_role run_init_roles;
1ee0a3
+		type run_init_t;
1ee0a3
+                role system_r;
1ee0a3
 	')
1ee0a3
 
1ee0a3
-	seutil_domtrans_runinit($1)
1ee0a3
-	roleattribute $2 run_init_roles;
1ee0a3
+	#seutil_domtrans_runinit($1)
1ee0a3
+	#roleattribute $2 run_init_roles;
1ee0a3
+
1ee0a3
+	        auth_run_chk_passwd(run_init_t, $2)
1ee0a3
+        seutil_domtrans_runinit($1)
1ee0a3
+        role $2 types run_init_t;
1ee0a3
+
1ee0a3
+        allow $2 system_r;
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################
1ee0a3
diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te
1ee0a3
index 90498cd..06b4e9a 100644
1ee0a3
--- a/policy/modules/system/selinuxutil.te
1ee0a3
+++ b/policy/modules/system/selinuxutil.te
1ee0a3
@@ -16,8 +16,8 @@ attribute seutil_semanage_domain;
1ee0a3
 
1ee0a3
 #attribute_role newrole_roles;
1ee0a3
 
1ee0a3
-attribute_role run_init_roles;
1ee0a3
-role system_r types run_init_t;
1ee0a3
+#attribute_role run_init_roles;
1ee0a3
+#role system_r types run_init_t;
1ee0a3
 
1ee0a3
 #attribute_role semanage_roles;
1ee0a3
 #roleattribute system_r semanage_roles;
1ee0a3
@@ -102,7 +102,8 @@ type run_init_t;
1ee0a3
 type run_init_exec_t;
1ee0a3
 application_domain(run_init_t, run_init_exec_t)
1ee0a3
 domain_system_change_exemption(run_init_t)
1ee0a3
-role run_init_roles types run_init_t;
1ee0a3
+#role run_init_roles types run_init_t;
1ee0a3
+role system_r types run_init_t;
1ee0a3
 
1ee0a3
 type semanage_t;
1ee0a3
 type semanage_exec_t;
1ee0a3
@@ -412,7 +413,7 @@ optional_policy(`
1ee0a3
 # Run_init local policy
1ee0a3
 #
1ee0a3
 
1ee0a3
-allow run_init_roles system_r;
1ee0a3
+#allow run_init_roles system_r;
1ee0a3
 
1ee0a3
 allow run_init_t self:process setexec;
1ee0a3
 allow run_init_t self:capability setuid;
1ee0a3
@@ -449,11 +450,17 @@ selinux_compute_user_contexts(run_init_t)
1ee0a3
 
1ee0a3
 term_use_console(run_init_t)
1ee0a3
 
1ee0a3
+#auth_use_nsswitch(run_init_t)
1ee0a3
+#auth_run_chk_passwd(run_init_t, run_init_roles)
1ee0a3
+#auth_run_upd_passwd(run_init_t, run_init_roles)
1ee0a3
+#auth_dontaudit_read_shadow(run_init_t)
1ee0a3
+
1ee0a3
 auth_use_nsswitch(run_init_t)
1ee0a3
-auth_run_chk_passwd(run_init_t, run_init_roles)
1ee0a3
-auth_run_upd_passwd(run_init_t, run_init_roles)
1ee0a3
+auth_domtrans_chk_passwd(run_init_t)
1ee0a3
+auth_domtrans_upd_passwd(run_init_t)
1ee0a3
 auth_dontaudit_read_shadow(run_init_t)
1ee0a3
 
1ee0a3
+
1ee0a3
 init_spec_domtrans_script(run_init_t)
1ee0a3
 # for utmp
1ee0a3
 init_rw_utmp(run_init_t)
1ee0a3
commit 4803dd3583e4c84e24a7f6974e195bb8145f1bb5
1ee0a3
Author: Miroslav Grepl <mgrepl@redhat.com>
1ee0a3
Date:   Thu Jun 7 10:01:51 2012 +0200
1ee0a3
1ee0a3
    One more for run_init
1ee0a3
1ee0a3
diff --git a/policy/modules/system/selinuxutil.if b/policy/modules/system/selinuxutil.if
1ee0a3
index 6903c5e..b64a37a 100644
1ee0a3
--- a/policy/modules/system/selinuxutil.if
1ee0a3
+++ b/policy/modules/system/selinuxutil.if
1ee0a3
@@ -502,11 +502,19 @@ interface(`seutil_run_runinit',`
1ee0a3
 #
1ee0a3
 interface(`seutil_init_script_run_runinit',`
1ee0a3
 	gen_require(`
1ee0a3
-		attribute_role run_init_roles;
1ee0a3
+		#attribute_role run_init_roles;
1ee0a3
+		type run_init_t;
52f92d
+                role system_r;
1ee0a3
 	')
1ee0a3
 
1ee0a3
-	seutil_init_script_domtrans_runinit($1)
1ee0a3
-	roleattribute $2 run_init_roles;
1ee0a3
+	#seutil_init_script_domtrans_runinit($1)
1ee0a3
+	#roleattribute $2 run_init_roles;
1ee0a3
+	        auth_run_chk_passwd(run_init_t, $2)
1ee0a3
+        seutil_init_script_domtrans_runinit($1)
1ee0a3
+        role $2 types run_init_t;
1ee0a3
+
1ee0a3
+        allow $2 system_r;
1ee0a3
+
1ee0a3
 ')
1ee0a3
 
1ee0a3
 ########################################