diff options
author | Sean E. Millichamp <sean@bruenor.org> | 2008-09-30 14:43:23 -0400 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-10-03 14:33:33 +1000 |
commit | a4110a39f34506507e653c3cb2a8b092bd14de92 (patch) | |
tree | b584beceea6b6e759e03d98d7b74aa5677dc6e1e /lib/puppet | |
parent | 250239eb7fa93dbacd2e755307a6c115615fe87b (diff) | |
download | puppet-a4110a39f34506507e653c3cb2a8b092bd14de92.tar.gz puppet-a4110a39f34506507e653c3cb2a8b092bd14de92.tar.xz puppet-a4110a39f34506507e653c3cb2a8b092bd14de92.zip |
Add SELinux context reset after file writes in Puppet::Util::FileType
Diffstat (limited to 'lib/puppet')
-rwxr-xr-x | lib/puppet/util/filetype.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |