summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)