From: cpebenito@tresys.com (Christopher J. PeBenito) Date: Fri, 07 Dec 2012 00:26:20 -0500 Subject: [refpolicy] [PATCH 5/7 v2] init.if: Add init_daemon_run_file interface In-Reply-To: <1354745711-27404-1-git-send-email-bigon@debian.org> References: <1354744731.25618.25.camel@localhost> <1354745711-27404-1-git-send-email-bigon@debian.org> Message-ID: <50C17DFC.6000506@tresys.com> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com On 12/5/2012 5:15 PM, Laurent Bigonville wrote: > 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) > +') pidfile isn't owned by this module. Additionally, I'm thinking that it would probably be better to generalize init_daemon_run_dir to take object classes as a parameter.... but I don't know what to call it. -- Chris PeBenito Tresys Technology, LLC www.tresys.com | oss.tresys.com