Rar permissions fix#6393
Conversation
I wanted to base it off of #6350 to have the logic unified before I made the change, so the extra commits are just 6350's. I can make it look pretty if you want after that's in; otherwise, squash is fine. (As you inferred, last commit was all I needed.) |
Ah. But that's destined for 17.0 while we want this in 16.10 because it fixes the precaching feature that's new there, right? |
Ugh. You're right, but that's going to make this much harder. I'll switch it to be based off of master, which should clean up the diff here, but when we merge the other one, there'll be a merge conflict, and we need to make sure to not do the obvious thing of "method was deleted --> delete change, too" and instead integrate the change into StateFileBase as I did here. |
new FileStream(stateFile, FileMode.Open) opens the file as if you had read/write access but only actually grants you read permissions. It still requires administrator privileges, however, if a file requires administrator privileges to write to. This removes that requirement.
905a7e5 to
2012309
Compare
|
I updated it to not be based on #6350 based on @rainersigwald's comment above. |
|
Did we decide to put this in 16.11, or 17.0? I have already forgotten 😬 |
16.11. We wanted to be able to specify that VS can use the latest 16.11 version rather than requiring 17.0 after the feature is turned on. |
Based on #6350 for convenience. That PR centralized the cache deserialization logic for StateFileBase, so it would be easy to accidentally overwrite this change with that one when resolving merge conflicts.Context
The precomputed cache from dotnet/installer#10037 lives in Program Files after it's installed on a new computer. Program Files can only be accessed with admin privileges, which not all users have and those that have generally wouldn't expect. This permits reading the precomputed cache even without admin rights.
Changes Made
Switch how the file is read.