Skip to content

Conversation

@bkatyl
Copy link

@bkatyl bkatyl commented Mar 2, 2021

Add support for AuthorizedKeysCommand and AuthorizedPrincipalsCommand to run as System.

  • When sshd is run as system and provided username is system, run command as subprocess using posix_spawnp
  • Improve debug logging in spawn_child_internal by providing different logging message for when CreateProcessW and CreateProcessAsUserW are called.

This is part 2 of the a 2 part PR to Fix issue #1546

… to run as System

Add support for AuthorizedKeysCommand and AuthorizedPrincipalsCommand to run as System.

- When sshd is run as system and provided username is system, run command as subprocess using posix_spawnp
- Improve debug logging in spawn_child_internal by providing different logging message for when CreateProcessW and CreateProcessAsUserW are called.

This is part 2 of the a 2 part PR to Fix issue #1546
@bagajjal
Copy link

Please resolve the conflicts in the auth.c file.

bkatyl and others added 2 commits March 17, 2021 12:17
- Added the needed includes, guarded by Windows ifdef.
- Added boolean variable to store determination with default of false.
- Moved evaluation into Windows only section since we're using SID comparison.
- Changed from string evaluation of "system" to comparing the SID of the user with WinLocalSystemSid.
Consolidating changes to be in one part of the file
@bagajjal bagajjal merged commit 6e76ad9 into PowerShell:latestw_all Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants