Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AuthorizedKeysCommand and AuthorizedPrincipalsCommand to run as System #479

Merged
merged 4 commits into from
Mar 27, 2021

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
auth.c Outdated Show resolved Hide resolved
@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.
auth.c Outdated Show resolved Hide resolved
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