diff --git a/lib/puppet/util/suidmanager.rb b/lib/puppet/util/suidmanager.rb index 6f09005e2..f8dbca79e 100644 --- a/lib/puppet/util/suidmanager.rb +++ b/lib/puppet/util/suidmanager.rb @@ -50,7 +50,8 @@ module Puppet::Util::SUIDManager # Runs block setting uid and gid if provided then restoring original ids def asuser(new_uid=nil, new_gid=nil) - return yield unless root? + return yield if Puppet.features.win32? or !root? + # We set both because some programs like to drop privs, i.e. bash. old_uid, old_gid = self.uid, self.gid old_euid, old_egid = self.euid, self.egid