-
Notifications
You must be signed in to change notification settings - Fork 145
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
[Windows 11] Topgrade uses Sudo when run as administrator #1025
Comments
Emm, I am no Windows expert, so I try to mirror my UNIX knowledge here. If |
I don't see why Sudo is needed when Topgrade itself is ran as administrator, as it can just spawn processes with administrator permissions. What mostly confuses me is that Topgrade seemed to be supposed to be run as Administrator in Windows 10 (as that was the only way to get (IIRC) Windows Update to work), but in Windows 11 suddenly uses Sudo regardless of privilege state. The best solution / optimal outcome that I can think of (both for Linux and Windows) is to support both running as root/administrator and running unprivileged. Then in the case of a privileged run, it should be able to run fully unattended (and hopefully still be able to upgrade tools that are not supposed to be run privileged, maybe by then switching back to the original user?), and when run unprivileged, it can sudo (and in the case of Linux, cache it). Just throwing ideas here, lmk what you think! |
Also no, Windows Sudo does no caching at all (by default anyway). I had to set it to "Inline" in the developer settings to properly work, and mirror what I saw in Windows 10 the best. |
Sorry for missing that So, under the administrator mode, |
Yes, it is certainly something that I would expect Windows sudo itself to do... Unfortunately it doesn't. I can try to implement this (skipping sudo on Windows when it is administrator) myself if I have time, would that be accepted? |
Yeah
Which sudo are you using? Is it open-source? Maybe we can file an issue there if so |
Run into the same problem, chocolatey step uses sudo even if topgrade already running as admin. |
This is the sudo that is built into Windows 11. When it is not enabled, some steps just crash with "enable sudo in the developer settings". It seems like Topgrade chooses to run sudo because it finds there is a I'm also considering looking for an alternative |
|
https://github.com/microsoft/sudo this one? Could you please file an issue there(for this weird behavior)?
Well, I hope this can be implemented. If we need to fix this within Topgrade, then all the steps that involve
Topgrade assumes as long as there is a sudo found in the
Does gsudo handle the administrator mode correctly? i.e., when in the administrator mode, sudo behaves like a no-op |
Relevant issue already exists: I agree that this is something sudo should fix themselves. I will experiment a bit with |
This is not actually the case. Running For me the issue is solved now; I will just keep running it as administrator for now, and if that ever causes an issue, I can always install gsudo.
Is this with the Windows 11 |
Yes.
Yes, it is. |
Good to hear!
So under administrator mode, |
See issue microsoft/sudo#119, Microsoft should fix this |
I want to suggest some general feature
In Windows 11, Topgrade should not use Sudo when run as administrator, but run the command directly.
More information
In Windows 10 running as administrator worked fine, but in Windows 11 I have to press "Yes" on Sudo's prompt multiple times (Windows Update, Microsoft Store). In Windows 10 some steps would simply fail if not run as administrator, but this is no better.
The text was updated successfully, but these errors were encountered: