summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-04 21:33:07 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-04 21:33:07 +0000
commit5e470b3fa7a2160e8f16cc9052252d05412f79a7 (patch)
treecf4eda5e060fd1d30a4ce38d1335f4d8290337fc
parentbb72a08729b559b8b5a2c35509e2e20a6a605535 (diff)
downloadpuppet-5e470b3fa7a2160e8f16cc9052252d05412f79a7.tar.gz
puppet-5e470b3fa7a2160e8f16cc9052252d05412f79a7.tar.xz
puppet-5e470b3fa7a2160e8f16cc9052252d05412f79a7.zip
Regressing to always creating files/directories as root, rather than trying to do it as the right user.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2044 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/puppet/type/pfile.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index 5d8a3a63e..25d1fbc88 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -1046,17 +1046,19 @@ module Puppet
# Run the block as the specified user if the dir is writeable, else
# run it as root (or the current user).
def write_if_writable(dir)
- asroot = true
- Puppet::SUIDManager.asuser(asuser(), self.should(:group)) do
- if FileTest.writable?(dir)
- asroot = false
- yield
- end
- end
-
- if asroot
- yield
- end
+ yield
+ # We're getting different behaviors from different versions of ruby, so...
+ # asroot = true
+ # Puppet::SUIDManager.asuser(asuser(), self.should(:group)) do
+ # if FileTest.writable?(dir)
+ # asroot = false
+ # yield
+ # end
+ # end
+ #
+ # if asroot
+ # yield
+ # end
end
end # Puppet.type(:pfile)