Avoid trying to set uid/gid on windows

This commit is contained in:
David Schmitt 2010-05-14 11:07:19 +02:00 коммит произвёл test branch
Родитель a90bcb08c3
Коммит bbba9f9f52
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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