diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 7a657f3cf..f37a18c28 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -510,6 +510,39 @@ interface(`init_daemon_pid_file',` files_pid_filetrans(initrc_t, $1, $2, $3) ') +######################################## +## +## Mark the file type as a daemon lock file, allowing initrc_t +## to create it +## +## +## +## Type to mark as a daemon lock file +## +## +## +## +## Class on which the type is applied +## +## +## +## +## Filename of the file that the init script creates +## +## +# +interface(`init_daemon_lock_file',` + gen_require(` + type initrc_t; + ') + + files_lock_file($1) + files_lock_filetrans(initrc_t, $1, $2, $3) + + allow initrc_t $1:dir manage_dir_perms; + allow initrc_t $1:file manage_file_perms; +') + ######################################## ## ## Mark the file type as a daemon run dir, allowing initrc_t