Open richlander opened 1 year ago
I was recently looking at another issue and then learned that under sudo
the SDK can fake a temporary HOME
directory. Because it's a new directory each time, you get the first time experience each time again.
This is the code responsible:
I have not looked further into why this happens, or how it could be improved.
Perhaps just skip all the first-run stuff and everything associated with it when running under sudo altogether?
I don't think we can skip the first run experience altogether when running under sudo as there are important notes about telemetry that we want to show customers. We could potentially write out the sentinel file for the first run to a common location when run under sudo and that might not run afoul of the prior security issues we had (which required moving this to a random folder).
Let's see if there is an option for that.
Yes, this is probably fallout from an MSRC fix I made last year. I think we could re-introduce the sentinel file in a public location without additional security risk as long as we only check for the file existence, and it's minimal work, so we could fix this.
FYI: Benchmarkdotnet requires sudo
for the best experience.
With dotnet run -c Release
, you will see:
Failed to set up high priority. Make sure you have the right permissions. Message: Permission denied
If you use sudo
then your test run gets high priority.
FYI: Benchmarkdotnet requires
sudo
for the best experience.With
dotnet run -c Release
, you will see:Failed to set up high priority. Make sure you have the right permissions. Message: Permission denied
If you use
sudo
then your test run gets high priority.
What if I don't wanna give it a permission?
You don't have to. If you try it you'll see that it is optional. I learned later that some people don't bother with that and so I stopped as well. Also, that's about benchmarkdotnet so out of scope for the conversation.
I propose that we disable telemetry and all the sentinel stuff when running under sudo
. If it all gets re-written every time, what's the value anyway?
This is my experience (on macOS). Same thing happens every time I call it.