All of lore.kernel.org
 help / color / mirror / Atom feed
From: cpebenito@tresys.com (Christopher J. PeBenito)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] RFC init_daemon_run_file
Date: Mon, 17 Mar 2014 09:41:36 -0400	[thread overview]
Message-ID: <5326FB90.7080306@tresys.com> (raw)
In-Reply-To: <20140304181459.GA26996@siphos.be>

On 3/4/2014 1:15 PM, Sven Vermeulen wrote:
> On Tue, Mar 04, 2014 at 06:25:07PM +0100, Sven Vermeulen wrote:
>> A couple of init scripts create PID files for their respective daemons
>> (domains) in the /run location. Right now, the SELinux policy supports
>> transitions for directories that are created in /run through the
>> init_daemon_run_dir() method.
> [...]
> 
> bigon mentioned on #selinux that this was suggested end of 2012 [1]. There,
> the suggestion was to generalize the existing method (init_daemon_run_dir)
> to one that takes the class with it. However, there was no concensus on the
> name (and "init_daemon_run" wouldn't cut it).
> 
> May I suggest the following?
> 
> interface(`init_script_generic_run_filetrans_spec',`
>   gen_require(`
>   	attribute daemonpidfile;
> 	type initrc_t;
>   ')
> 
>   typeattribute $1 daemonpidfile;
> 
>   files_pid_filetrans(initrc_t, $1, $2, $3)
> ')
> 
> The name would be chosen due to the following:
> 
> - init_script_ (instead of init_) to identify that this is about initrc_t.
> - generic_run_ to inform that we start from the generic run type (var_run_t)
> - filetrans_ (because it is a file transition)
> - spec (because it transitions to the specified type rather than a
>   module-provided one).

I think I'd go with init_daemon_pid_file().  I'm thinking that we should skip the "script" portion since it's not so relevant; with systemd coming along, the init/initrc line is blurring or disappearing.  I think the interface should also be calling files_pid_file().

-- 
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com

      reply	other threads:[~2014-03-17 13:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 17:25 [refpolicy] RFC init_daemon_run_file Sven Vermeulen
2014-03-04 18:15 ` Sven Vermeulen
2014-03-17 13:41   ` Christopher J. PeBenito [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5326FB90.7080306@tresys.com \
    --to=cpebenito@tresys.com \
    --cc=refpolicy@oss.tresys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.