opscode/mixlib-shellout — pull request #11 by adamedx (2013-03-26 17:15:34+00:00)
Title: MIXLIB 9: Add Windows Impersonation to Mixlib-Shellout

This change adds the ability to run a process as an alternate user on Windows, enabling Windows parity with Unix in this area. Unlike Unix, Windows requires credentials (in this case the user name + password) where Unix only requires a user name, so the change adds the ability to specify the password and also the Windows domain. While there may be ways to gain this functionality without requiring a password, any such process would not be able to authenticate outside of the local computer (domain resources would fail to allow access to an entity that had not presented credentials that could be authorized against a resource), and a key use case here is the ability for the process to authenticate when accessing domain resources.

This functionality was intended to work earlier, but because the password was not being passed to the call to create the process, specification of a user on Windows failed. Additionally, this fix has code to handle the special case of creating a process from both interactive and non-interactive sessions.