Issue #18429 has been updated by Andy Bohne.

I am also experiencing this.

I am using the [puppet-selinux 
module](https://github.com/jfryman/puppet-selinux) to ensure that selinux 
remains disabled on my nodes.

I narrowed the issue down to line 38-39 in 
`/usr/lib/ruby/site_ruby/1.8/facter/selinux.rb`.

<pre><code class="ruby">if FileTest.exists?("/proc/self/attr/current")
  if (File.read("/proc/self/attr/current") != "kernel\0")
</code></pre>

With selinux disabled:
<pre>[root@template ~]# cat /proc/self/attr/current
cat: /proc/self/attr/current: Invalid argument</pre>

With selinux enabled:
<pre>[root@template ~]# cat /proc/self/attr/current 
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023</pre>

I have tested on both RHEL 6 and Fedora 18 with the same results.

I'm not sure what the preferred fix would be.  My first thought we be to rescue 
the exception that is generated when trying the `File.read`

----------------------------------------
Bug #18429: SELinux off - Could not retrieve selinux: Invalid argument
https://projects.puppetlabs.com/issues/18429#change-87383

* Author: Jonas Genannt
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Keywords: selinux
* Branch: 
* Affected Facter version: 1.6.14
----------------------------------------
if you switch off selinux on Linux with `echo 0 > /selinux/enforce` and run 
facter selinux:

facter selinux
Could not retrieve selinux: Invalid argument - /proc/self/attr/current



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to