HomePhorge

(#8662) Fix Puppet.features.root? on Windows
2ac87905708dUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#8662) Fix Puppet.features.root? on Windows

This commit changes Puppet::Util::SUIDManager.root? (and
Puppet.features.root?) to only return true if the user is running with
elevated privileges (granted via UAC). If this check fails because
elevated privileges are not supported, e.g. pre-Vista, then we fall
back to checking if the user is a member of the builtin Administrators
group.

This means if you are logged in as Administrator on 2008,
Puppet.features.root? will return false, unless you are explicitly
running puppet as an administrator, e.g.

runas /user:Administrator "puppet apply manifest.pp"

This commit also adds tests to ensure SUIDManager.asuser is a no-op on
Windows, since Windows does not (easily) support switching user
contexts without providing a password.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUccdd043ab309: (#8662) Break circular feature dependency
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU2ac87905708d: (#8662) Fix Puppet.features.root? on Windows (authored by Josh Cooper <josh@puppetlabs.com>).Aug 23 2011, 12:06 AM