From a4110a39f34506507e653c3cb2a8b092bd14de92 Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Tue, 30 Sep 2008 14:43:23 -0400 Subject: Add SELinux context reset after file writes in Puppet::Util::FileType --- lib/puppet/util/filetype.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/puppet/util/filetype.rb b/lib/puppet/util/filetype.rb index 8dcb67286..7e799b613 100755 --- a/lib/puppet/util/filetype.rb +++ b/lib/puppet/util/filetype.rb @@ -1,8 +1,13 @@ # Basic classes for reading, writing, and emptying files. Not much # to see here. + +require 'puppet/util/selinux' + class Puppet::Util::FileType attr_accessor :loaded, :path, :synced + include Puppet::Util::SELinux + class << self attr_accessor :name include Puppet::Util::ClassGen @@ -109,6 +114,8 @@ class Puppet::Util::FileType tf.print text; tf.flush FileUtils.cp(tf.path, @path) tf.close + # If SELinux is present, we need to ensure the file has its expected context + set_selinux_default_context(@path) end end -- cgit