lib/facter/selinux.rb in facter-1.6.2 vs lib/facter/selinux.rb in facter-1.6.3

- old
+ new

@@ -10,11 +10,11 @@ # Fact for SElinux # Written by immerda admin team (admin(at)immerda.ch) sestatus_cmd = '/usr/sbin/sestatus' -# This supports the fact that the selinux mount point is not always in the +# This supports the fact that the selinux mount point is not always in the # same location -- the selinux mount point is operating system specific. def selinux_mount_point if FileTest.exists?('/proc/self/mountinfo') File.open('/proc/self/mountinfo') do |f| f.grep(/selinuxfs/) do |line| @@ -27,11 +27,11 @@ end Facter.add("selinux") do confine :kernel => :linux setcode do - result = "false" + result = "false" if FileTest.exists?("#{selinux_mount_point}/enforce") if FileTest.exists?("/proc/self/attr/current") if (File.read("/proc/self/attr/current") != "kernel\0") result = "true" end @@ -88,10 +88,10 @@ mode.each_line { |l| result = $1 if l =~ /^Policy from config file\:\s+(\w+)$/i } result.chomp end end -# This is a legacy fact which returns the old selinux_mode fact value to prevent +# This is a legacy fact which returns the old selinux_mode fact value to prevent # breakages of existing manifests. It should be removed at the next major release. # See ticket #6677. Facter.add("selinux_mode") do confine :selinux => :true