From: bigon@debian.org (Laurent Bigonville) Date: Wed, 5 Dec 2012 23:15:11 +0100 Subject: [refpolicy] [PATCH 5/7 v2] init.if: Add init_daemon_run_file interface In-Reply-To: <1354744731.25618.25.camel@localhost> References: <1354744731.25618.25.camel@localhost> Message-ID: <1354745711-27404-1-git-send-email-bigon@debian.org> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com From: Laurent Bigonville This is allowing initscripts to create pidfile and to let them transition to their context --- policy/modules/system/init.if | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 3f0c2d3..66a4869 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -444,6 +444,33 @@ interface(`init_daemon_run_dir',` ######################################## ## +## Mark the file type as a pid file, allowing initrc_t +## to create it +## +## +## +## Type to mark as a pid file +## +## +## +## +## The name of the object being created. +## +## +# +interface(`init_daemon_run_file',` + gen_require(` + attribute pidfile; + type initrc_t; + ') + + typeattribute $1 pidfile; + + files_pid_filetrans(initrc_t, $1, file, $2) +') + +######################################## +## ## Execute init (/sbin/init) with a domain transition. ## ## -- 1.7.10.4