class Puppet::SELFileContext

Public Instance Methods

insync?(value) click to toggle source
Calls superclass method Puppet::Property#insync?
   # File lib/puppet/type/file/selcontext.rb
56 def insync?(value)
57   if not selinux_support?
58     debug("SELinux bindings not found. Ignoring parameter.")
59     true
60   elsif not selinux_label_support?(@resource[:path])
61     debug("SELinux not available for this filesystem. Ignoring parameter.")
62     true
63   else
64     super
65   end
66 end
retrieve() click to toggle source
   # File lib/puppet/type/file/selcontext.rb
30 def retrieve
31   return :absent unless @resource.stat
32   context = self.get_selinux_current_context(@resource[:path])
33   is = parse_selinux_context(name, context)
34   if name == :selrange and selinux_support?
35     self.selinux_category_to_label(is)
36   else
37     is
38   end
39 end
retrieve_default_context(property) click to toggle source
   # File lib/puppet/type/file/selcontext.rb
41 def retrieve_default_context(property)
42   if @resource[:selinux_ignore_defaults] == :true
43     return nil
44   end
45 
46   context = self.get_selinux_default_context(@resource[:path], @resource[:ensure])
47   unless context
48     return nil
49   end
50 
51   property_default = self.parse_selinux_context(property, context)
52   self.debug "Found #{property} default '#{property_default}' for #{@resource[:path]}" if not property_default.nil?
53   property_default
54 end
sync() click to toggle source
   # File lib/puppet/type/file/selcontext.rb
80 def sync
81   self.set_selinux_context(@resource[:path], @should, name)
82   :file_changed
83 end
unsafe_munge(should) click to toggle source
   # File lib/puppet/type/file/selcontext.rb
68 def unsafe_munge(should)
69   if not selinux_support?
70     return should
71   end
72 
73   if name == :selrange
74     self.selinux_category_to_label(should)
75   else
76     should
77   end
78 end