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 SYSTEM to explicit ACLs #2370

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Jul 26, 2022

Fixes #2365 (Hopefully... it actually worked fine on my machine before this change.)

Change

Add support for SYSTEM to the explicit ACLs, and give SYSTEM full control on the Temp directory.

ApplyACL and the data that it uses are basically re-written to support a more dynamic list of ACEs. Also ensures that if the process is running as SYSTEM, it doesn't attempt to write the same ACE multiple times.

Validation

Existing tests and a new unit test for this scenario. Manually ran as SYSTEM to ensure that it does the correct thing.

Microsoft Reviewers: Open in CodeFlow

…l access to Temp as that is where we install from.
@JohnMcPMS JohnMcPMS requested a review from a team as a code owner July 26, 2022 00:25
@ghost ghost added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jul 26, 2022
EXPLICIT_ACCESS_W explicitAccess[2];
// Configuring permissions for both CurrentUser and SYSTEM while not having owner set as one of them is not valid because
// below we use only the owner permissions in the case of running as SYSTEM.
if ((hasCurrentUser && hasSystem) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

(hasCurrentUser && hasSystem)

If this check is only for scenarios when running as system, should we make the condition in parity with later usage

(hasCurrentUser && hasSystem && EqualSid(userToken->User.Sid, systemSID.get())

Or just throw when it's actually used.

Copy link
Member Author

Choose a reason for hiding this comment

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

The point is to discover a configuration that would be illegal in that case without actually needing to be running as SYSTEM.

Copy link
Contributor

@yao-msft yao-msft left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

winget 1.4.2011-preview can't install MSI-based applications
2 participants