commit:     1d291587f6308317bfd3a37227a00d68092e9c40
Author:     Jason Zaman <jason <AT> perfinion <DOT> com>
AuthorDate: Mon Feb  9 08:40:08 2015 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Mon Feb  9 09:52:54 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=1d291587

Revert "Reshuffle and update with upstream"

This reverts commit fe62598f2fb87fe0dfca34f82311ffd29df37795.

the domtrans pattern part broke openrc without run_init,
that part relies on being in the run_init domain and then
does the transition. this was transitioning directly into
initrc_t but that does not work with being in sysadm_r.

---
 policy/modules/system/init.if | 82 +++++++++++++++++++------------------------
 1 file changed, 36 insertions(+), 46 deletions(-)

diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if
index 4d923d6..7cdf3a8 100644
--- a/policy/modules/system/init.if
+++ b/policy/modules/system/init.if
@@ -150,6 +150,39 @@ interface(`init_ranged_domain',`
 
 ########################################
 ## <summary>
+##     Mark the file type as a daemon pid file, allowing initrc_t
+##     to create it
+## </summary>
+## <param name="filetype">
+##     <summary>
+##     Type to mark as a daemon pid file
+##     </summary>
+## </param>
+## <param name="class">
+##     <summary>
+##     Class on which the type is applied
+##     </summary>
+## </param>
+## <param name="filename">
+##     <summary>
+##     Filename of the file that the init script creates
+##     </summary>
+## </param>
+#
+interface(`init_daemon_pid_file',`
+       gen_require(`
+               attribute daemonpidfile;
+               type initrc_t;
+       ')
+
+       typeattribute $1 daemonpidfile;
+
+       files_pid_file($1)
+       files_pid_filetrans(initrc_t, $1, $2, $3)
+')
+
+########################################
+## <summary>
 ##     Create a domain for long running processes
 ##     (daemons/services) which are started by init scripts.
 ## </summary>
@@ -388,50 +421,16 @@ interface(`init_ranged_system_domain',`
 
 ########################################
 ## <summary>
-##     Mark the file type as a daemon pid file, allowing initrc_t
-##     to create it
+##     Mark the type as a daemon run dir
 ## </summary>
-## <param name="filetype">
-##     <summary>
-##     Type to mark as a daemon pid file
-##     </summary>
-## </param>
-## <param name="class">
-##     <summary>
-##     Class on which the type is applied
-##     </summary>
-## </param>
-## <param name="filename">
-##     <summary>
-##     Filename of the file that the init script creates
-##     </summary>
-## </param>
-#
-interface(`init_daemon_pid_file',`
-       gen_require(`
-               attribute daemonpidfile;
-               type initrc_t;
-       ')
-
-       typeattribute $1 daemonpidfile;
-
-       files_pid_file($1)
-       files_pid_filetrans(initrc_t, $1, $2, $3)
-')
-
-########################################
-## <summary>
-##     Mark the file type as a daemon run dir, allowing initrc_t
-##     to create it
-## </summary>
-## <param name="filetype">
+## <param name="rundirtype">
 ##     <summary>
 ##     Type to mark as a daemon run dir
 ##     </summary>
 ## </param>
 ## <param name="filename">
 ##     <summary>
-##     Filename of the directory that the init script creates
+##     Name of the run dir directory
 ##     </summary>
 ## </param>
 #
@@ -844,14 +843,6 @@ interface(`init_spec_domtrans_script',`
        files_list_etc($1)
        spec_domtrans_pattern($1, initrc_exec_t, initrc_t)
 
-       ifdef(`distro_gentoo',`
-               gen_require(`
-                       type rc_exec_t;
-               ')
-
-               domtrans_pattern($1, rc_exec_t, initrc_t)
-       ')
-
        ifdef(`enable_mcs',`
                range_transition $1 initrc_exec_t:process s0;
        ')
@@ -891,7 +882,6 @@ interface(`init_domtrans_script',`
                gen_require(`
                        type rc_exec_t;
                ')
-
                domtrans_pattern($1, rc_exec_t, initrc_t)
        ')
 ')

Reply via email to