libselinux question for httpd

Stephen Smalley sds at tycho.nsa.gov
Thu Nov 3 13:35:56 UTC 2005


On Thu, 2005-11-03 at 09:52 +0000, Joe Orton wrote:
> Is there is a simple libselinux call I can make in httpd to determine 
> whether or not the SELinux policy is enabled and applied?
> 
> I'd like to add a one-line notice to the default error_log when it is, 
> to give an obvious tip-off to confused new users.

is_selinux_enabled() will return > 0 if SELinux is enabled.
getcon(&con) will set con to the context in which the process is
running.

-- 
Stephen Smalley
National Security Agency




More information about the fedora-selinux-list mailing list