All of lore.kernel.org
 help / color / mirror / Atom feed
* SELinux type transition rule not working
@ 2017-03-01 21:40 Ian Pilcher
  2017-03-01 22:25 ` [systemd-devel] " Lennart Poettering
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Ian Pilcher @ 2017-03-01 21:40 UTC (permalink / raw)
  To: selinux; +Cc: Systemd

I am using systemd's RuntimeDirectory to create a directory for a
service.

    RuntimeDirectory=squoxy

This causes systemd to create /run/squoxy before starting my service,
but I haven't been able to get the SELinux context set correctly on the
directory.

I've set file context rules for both /run/squoxy and /var/run/squoxy:

^/var/run/squoxy(/.*)?  all files  system_u:object_r:squoxy_var_run_t:s0
^/run/squoxy(/.*)?      all files  system_u:object_r:squoxy_var_run_t:s0

And, indeed, restorecon will set the context of the directory to
squoxy_var_run_t.

I've also added a type transition rule, attempting to get the correct
context applied automatically when systemd creates the directory:

type_transition init_t var_run_t : dir squoxy_var_run_t "squoxy";

But the directory is still being created as var_run_t:

drwxr-xr-x. nobody nobody system_u:object_r:var_run_t:s0   /run/squoxy

What am I doing wrong?

-- 
========================================================================
Ian Pilcher                                         arequipeno@gmail.com
-------- "I grew up before Mark Zuckerberg invented friendship" --------
========================================================================

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-03-03 21:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01 21:40 SELinux type transition rule not working Ian Pilcher
2017-03-01 22:25 ` [systemd-devel] " Lennart Poettering
2017-03-02 15:13   ` Simon Sekidde
2017-03-03 15:44     ` Ian Pilcher
2017-03-03 16:01       ` Simon Sekidde
2017-03-03 16:45         ` Simon Sekidde
2017-03-03 19:32           ` Ian Pilcher
2017-03-03 20:19             ` Simon Sekidde
2017-03-03 21:00               ` Ian Pilcher
2017-03-01 22:28 ` cgzones
2017-03-01 23:28   ` Ian Pilcher
2017-03-01 23:51     ` Ian Pilcher
2017-03-02  6:12       ` Jason Zaman
2017-03-03 15:36         ` Ian Pilcher
2017-03-03 15:47           ` Stephen Smalley
2017-03-02  2:16 ` Russell Coker

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.