@@ -40,11 +40,12 @@ def retrieve
4040 end
4141
4242 def retrieve_default_context ( property )
43+ return nil if Puppet ::Util ::Platform . windows?
4344 if @resource [ :selinux_ignore_defaults ] == :true
4445 return nil
4546 end
4647
47- context = get_selinux_default_context ( @resource [ :path ] , @resource [ :ensure ] )
48+ context = get_selinux_default_context_with_handle ( @resource [ :path ] , provider . class . selinux_handle )
4849 unless context
4950 return nil
5051 end
@@ -85,7 +86,7 @@ def sync
8586 end
8687
8788 Puppet ::Type . type ( :file ) . newparam ( :selinux_ignore_defaults ) do
88- desc "If this is set then Puppet will not ask SELinux (via matchpathcon ) to
89+ desc "If this is set then Puppet will not ask SELinux (via selabel_lookup ) to
8990 supply defaults for the SELinux attributes (seluser, selrole,
9091 seltype, and selrange). In general, you should leave this set at its
9192 default and only set it to true when you need Puppet to not try to fix
@@ -98,7 +99,7 @@ def sync
9899 Puppet ::Type . type ( :file ) . newproperty ( :seluser , :parent => Puppet ::SELFileContext ) do
99100 desc "What the SELinux user component of the context of the file should be.
100101 Any valid SELinux user component is accepted. For example `user_u`.
101- If not specified it defaults to the value returned by matchpathcon for
102+ If not specified it defaults to the value returned by selabel_lookup for
102103 the file, if any exists. Only valid on systems with SELinux support
103104 enabled."
104105
@@ -109,7 +110,7 @@ def sync
109110 Puppet ::Type . type ( :file ) . newproperty ( :selrole , :parent => Puppet ::SELFileContext ) do
110111 desc "What the SELinux role component of the context of the file should be.
111112 Any valid SELinux role component is accepted. For example `role_r`.
112- If not specified it defaults to the value returned by matchpathcon for
113+ If not specified it defaults to the value returned by selabel_lookup for
113114 the file, if any exists. Only valid on systems with SELinux support
114115 enabled."
115116
@@ -120,7 +121,7 @@ def sync
120121 Puppet ::Type . type ( :file ) . newproperty ( :seltype , :parent => Puppet ::SELFileContext ) do
121122 desc "What the SELinux type component of the context of the file should be.
122123 Any valid SELinux type component is accepted. For example `tmp_t`.
123- If not specified it defaults to the value returned by matchpathcon for
124+ If not specified it defaults to the value returned by selabel_lookup for
124125 the file, if any exists. Only valid on systems with SELinux support
125126 enabled."
126127
@@ -132,7 +133,7 @@ def sync
132133 desc "What the SELinux range component of the context of the file should be.
133134 Any valid SELinux range component is accepted. For example `s0` or
134135 `SystemHigh`. If not specified it defaults to the value returned by
135- matchpathcon for the file, if any exists. Only valid on systems with
136+ selabel_lookup for the file, if any exists. Only valid on systems with
136137 SELinux support enabled and that have support for MCS (Multi-Category
137138 Security)."
138139
0 commit comments