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

Cleanup SeServiceLogonRight For Restricted User Account #328

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

NoMoreFood
Copy link

  • After creating a user token, the SeServiceLogonRight is now removed from the account so it does not create an orphaned reference in the local security policy.
  • Other small code changes for code style consistency within the file.

- After creating a user token, the SeServiceLogonRight is now removed from the account so it does not create an orphaned reference in the local security policy.
- Other small code changes for code style consistency within the file.
@NoMoreFood
Copy link
Author

Addresses: PowerShell/Win32-OpenSSH#1202

/* attempt to remove virtual account permissions if previous add succeeded */
if (lsa_add_ret == STATUS_SUCCESS)
if ((lsa_ret = LsaRemoveAccountRights(lsa_policy, sid_user, FALSE, &svcLogonRight, 1)) != STATUS_SUCCESS)
debug("%s: unable to remove SE_SERVICE_LOGON_NAME privilege, error: %d", __FUNCTION__, pRtlNtStatusToDosError(lsa_ret));
Copy link

@bagajjal bagajjal Jul 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change it to error.

@manojampalam manojampalam merged commit 856078b into PowerShell:latestw_all Jul 3, 2018
@NoMoreFood NoMoreFood deleted the policy_fix branch July 4, 2018 06:52
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.

4 participants