summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-30 19:04:24 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-30 19:04:24 +0000
commit65f6656b58f35faa6566b27a0595c656a0e36765 (patch)
tree053df210620918ee92b6fe4725ab7212755f6caf
parent0ad65e9863ccfd1624d183e08c574172abd2acb6 (diff)
downloadpuppet-65f6656b58f35faa6566b27a0595c656a0e36765.tar.gz
puppet-65f6656b58f35faa6566b27a0595c656a0e36765.tar.xz
puppet-65f6656b58f35faa6566b27a0595c656a0e36765.zip
Added some code that could be used later to make sure the user and mode are also copied on backups.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1151 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/puppet/type/pfile.rb4
-rw-r--r--test/types/file.rb14
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index c383dfc93..8d4cf86bf 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -271,8 +271,8 @@ module Puppet
end
end
begin
- # Shouldn't this just use a Puppet object with 'source'
- # specified?
+ # FIXME Shouldn't this just use a Puppet object with
+ # 'source' specified?
bfile = file + backup
FileUtils.cp(file, bfile)
diff --git a/test/types/file.rb b/test/types/file.rb
index 2eeb2b2a5..18dedd02d 100644
--- a/test/types/file.rb
+++ b/test/types/file.rb
@@ -1091,6 +1091,15 @@ class TestFile < Test::Unit::TestCase
)
}
+# user = group = nil
+# if Process.uid == 0
+# user = nonrootuser
+# group = nonrootgroup
+# obj[:owner] = user.name
+# obj[:group] = group.name
+# File.chown(user.uid, group.gid, file)
+# end
+
assert_apply(obj)
backupfile = file + obj[:backup]
@@ -1101,6 +1110,11 @@ class TestFile < Test::Unit::TestCase
assert_equal(0411, filemode(backupfile),
"File mode is wrong for backupfile")
+# if Process.uid == 0
+# assert_equal(user.uid, File.stat(backupfile).uid)
+# assert_equal(group.gid, File.stat(backupfile).gid)
+# end
+
bucket = "bucket"
bpath = tempfile()
Dir.mkdir(bpath)