-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Sessions can now be run in a Windows Service context (#97)
feat(WIP): Sessions can now be run in a Windows Service context Problem: Windows requires the use of different Win32 APIs to impersonate users when you're running in the context of a Service (Windows Session ID 0) than if you're running in an interactive logon session. The current code uses CreateProcessWithLogonW to do impersonation, and that API does not work inside Session 0. Solution: Detect when we are running in Session 0, and make use of CreateProcessAsUserW instead in that case. To support this we require that when running in Session 0, the caller of this library create the WindowsSessionUser using the handle to a logon token that they create with the Win32 APIs rather than with a password directly. Limitation / Known Issues: Impersonation tests on Windows do not load the user's profile. We don't have any tests that actually *need* it; the library expects is caller to manage the logon token and profile load. Including a profile load in tests was the source of another mysterious crash when we tried to unload the profile. Signed-off-by: Daniel Neilson <[email protected]>
- Loading branch information
Showing
29 changed files
with
1,615 additions
and
661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.