summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-30 18:46:24 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-30 18:46:24 +0000
commit0ad65e9863ccfd1624d183e08c574172abd2acb6 (patch)
treeb149ebf266c62428414228f91e610e409c5f1f0a
parent84db91e7fcd2027431ad0a3d7177ac7c11a8d48e (diff)
downloadpuppet-0ad65e9863ccfd1624d183e08c574172abd2acb6.tar.gz
puppet-0ad65e9863ccfd1624d183e08c574172abd2acb6.tar.xz
puppet-0ad65e9863ccfd1624d183e08c574172abd2acb6.zip
Adding a check to make sure the mode is copied over.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1150 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/puppet/type/pfile.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index 5343d8a50..c383dfc93 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -271,7 +271,15 @@ module Puppet
end
end
begin
- FileUtils.cp(file, file + backup)
+ # Shouldn't this just use a Puppet object with 'source'
+ # specified?
+ bfile = file + backup
+ FileUtils.cp(file, bfile)
+
+ unless File.stat(file).mode == File.stat(bfile).mode
+ mode = File.stat(file).mode & 007777
+ File.chown(mode, bfile)
+ end
return true
rescue => detail
# since they said they want a backup, let's error out