diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-27 17:36:42 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-27 17:36:42 +0000 |
commit | 244a11d36f70ea38a85de709dc7cfcb80b610f7e (patch) | |
tree | d346e49b891719dcddeea38de9934beb076fe88b /lib/puppet | |
parent | 674841cd2b218e1425b0337d1839d54392c5b2b9 (diff) | |
download | puppet-244a11d36f70ea38a85de709dc7cfcb80b610f7e.tar.gz puppet-244a11d36f70ea38a85de709dc7cfcb80b610f7e.tar.xz puppet-244a11d36f70ea38a85de709dc7cfcb80b610f7e.zip |
Fixing what I hope are the last batch of problems caused by the addition of the suidmanager module. Also fixing a couple of other small issues that somehow cropped up. All tests should now pass again.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1699 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/suidmanager.rb | 4 | ||||
-rw-r--r-- | lib/puppet/util.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/suidmanager.rb b/lib/puppet/suidmanager.rb index a431e1456..4d00f59b0 100644 --- a/lib/puppet/suidmanager.rb +++ b/lib/puppet/suidmanager.rb @@ -63,6 +63,10 @@ module Puppet module_function :system def asuser(new_euid=nil, new_egid=nil) + # Unless we're root, don't do a damn thing. + unless Process.uid == 0 + return yield + end old_egid = old_euid = nil if new_egid saved_state_egid = new_egid diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index 5f8d6f31a..0141d1c3c 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -5,7 +5,7 @@ require 'puppet/lock' module Puppet # A command failed to execute. - class ExecutionFailure < RuntimeError + class ExecutionFailure < Puppet::Error end module Util require 'benchmark' |