<?xml version="1.0" encoding="UTF-8"?>
<issue>
  <id>1327</id>
  <project name="Facter" id="2"/>
  <tracker name="Feature" id="2"/>
  <status name="Closed" id="5"/>
  <priority name="Low" id="3"/>
  <author name="Frank Sweetser" id="172"/>
  <assigned_to name="Luke Kanies" id="2"/>
  <category name="library" id="37"/>
  <fixed_version name="1.5.5" id="31"/>
  <subject>Add facts for SELinux state</subject>
  <description>As part of the work I'm doing to add SELinux support to Puppet (http://spook.wpi.edu) it would be very useful if Facter were to have some SELinux facts.  At this point, I have identified two facts indicating the overall global state of SELinux of a machine which should be widely useful, both for what configuration settings should be pushed out and for auditing the SELinux state of a machine:

* selinux - whether the machine supports SELinux, and if so, what mode it is in (enforcing, permissive, disabled)
* selinuxpolicy - which policy is loaded (strict, targeted, mls)

I'm attaching a first pass at code for these facts that works for me.</description>
  <start_date></start_date>
  <due_date></due_date>
  <done_ratio>0</done_ratio>
  <estimated_hours></estimated_hours>
  <custom_fields>
    <custom_field name="Keywords" id="12"></custom_field>
    <custom_field name="Branch" id="13"></custom_field>
  </custom_fields>
  <created_on>Thu Jan 10 22:35:22 +0000 2008</created_on>
  <updated_on>Mon May 11 07:23:38 +0000 2009</updated_on>
  <changesets>
    <changeset revision="f94abfccfd6687a88f62703e4005c28ec04467a1">
      <user name="James Turnbull" id="27"/>
      <comments>Fixed #1327 - Added SELinux facts</comments>
      <committed_on>Sun May 10 11:51:40 +0000 2009</committed_on>
    </changeset>
    <changeset revision="cd60d7cd697d53e4b1d90d08bccd6118e9afbf8f">
      <user name="James Turnbull" id="27"/>
      <comments>Fixed #1327 - Added SELinux facts</comments>
      <committed_on>Tue Sep 22 09:17:06 +0000 2009</committed_on>
    </changeset>
  </changesets>
  <journals>
    <journal id="3213">
      <user name="Frank Sweetser" id="172"/>
      <notes>Can you describe what changes you'd like to see before accepting?</notes>
      <details>
      </details>
    </journal>
    <journal id="3214">
      <user name="James Turnbull" id="27"/>
      <notes>Reverted this commit in [2b0679994e73518c767c559fd1541767c2d5bad9] in branch master.

Still don't like this fact and needs some more work.</notes>
      <details>
      </details>
    </journal>
    <journal id="3215">
      <user name="James Turnbull" id="27"/>
      <notes>Fixed in commit [b3962ef307678d1be70ece96a284fdd2d63b064d] in master.</notes>
      <details>
      </details>
    </journal>
    <journal id="3216">
      <user name="Peter Meier" id="171"/>
      <notes>beside that's not yet clear what might be the better way I add our facts which are slightly different but propose more options. I'm willing to merge them together if the needed work is defined to push them to master.
Our facts:

:selinux =&gt; true/false (is selinux a topic?)
:selinux_enabled =&gt; true/false (is selinux enabled)
:selinux_policyversion =&gt; $version of the policy
:selinux_mode =&gt; targeted/strict (mode of selinux)</notes>
      <details>
      </details>
    </journal>
    <journal id="3488">
      <user name="Redmine Admin" id="1"/>
      <notes></notes>
      <details>
        <detail old="1" name="status_id" property="attr" new="9"/>
      </details>
    </journal>
    <journal id="3704">
      <user name="Luke Kanies" id="2"/>
      <notes></notes>
      <details>
        <detail old="9" name="status_id" property="attr" new="11"/>
      </details>
    </journal>
    <journal id="3705">
      <user name="Luke Kanies" id="2"/>
      <notes>What's the state of this code?</notes>
      <details>
        <detail old="11" name="status_id" property="attr" new="8"/>
      </details>
    </journal>
    <journal id="6865">
      <user name="Neil Katin" id="339"/>
      <notes>I just tested the selinux.rb file on my system; it worked fine for me.

This issue seems fairly idle.  Is there any chance it could be merged?  Or is there extra work that needs to be done?
</notes>
      <details>
      </details>
    </journal>
    <journal id="6868">
      <user name="Neil Katin" id="339"/>
      <notes>
I found a small bug in selinux.rb; it didn't work properly if the selinux kernel module was loaded, but selinux was disabled.

I mirrored the code that sestatus uses to detect when selinux is enabled (it checks the current context, and makes sure it is not &quot;kernel&quot;).

I've attached a new version of selinux.rb with the changes.
</notes>
      <details>
        <detail old="" name="595" property="attachment" new="selinux.rb"/>
      </details>
    </journal>
    <journal id="6870">
      <user name="Luke Kanies" id="2"/>
      <notes>I'll get this merged into the next release.</notes>
      <details>
        <detail old="" name="fixed_version_id" property="attr" new="28"/>
      </details>
    </journal>
    <journal id="7250">
      <user name="James Turnbull" id="27"/>
      <notes>Pushed in commit:&quot;e95620215e9f645423d14bd54f16fcba75d90b29&quot; in branch master.</notes>
      <details>
        <detail old="8" name="status_id" property="attr" new="5"/>
      </details>
    </journal>
    <journal id="7268">
      <user name="James Turnbull" id="27"/>
      <notes></notes>
      <details>
        <detail old="28" name="fixed_version_id" property="attr" new="31"/>
      </details>
    </journal>
  </journals>
</issue>
