On Thu, Feb 20, 2014 at 1:36 PM, Lennart Poettering <lennart@poettering.net> wrote:<br>
<blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">On Thu, 20.02.14 18:17, Colin Walters (walters@verbum.org) wrote:

Hmm, maybe a simple check access("/etc/selinux/", F_OK) would be enough?
There's no point in trying to initialized SELinux if that dir does not
exist, right? Then we could simply bypass the whole thing...</div></blockquote><div><br></div><div>Beyond what Eric said, I also think that libselinux should continue to contain all of the key logic for whether or not SELinux is enabled and how to behave.</div><div><br></div><div>The current *API* seems OK in having the two return values of an error code and an enforcing flag.</div><div><br></div><div>The only thing libselinux can't know is:</div><div>1) Whether we're inside an initramfs right now</div><div>2) Whether or not the OS vendor expects policy to be found in the real root or the initramfs</div><div><br></div><div>So those bits of logic make sense to me in systemd, although there is an argument for #2 living in libselinux.</div><div><br></div><div><br></div>