-
Notifications
You must be signed in to change notification settings - Fork 57
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
Sudo doesn't prompt for elevation #1
Comments
I do... I'll try to look into the issue. |
This seems to be the problem: https://github.com/lukesampson/psutils/blob/master/sudo.ps1#L72 If the user is not an admin, the |
Oh right—thanks for looking into it. I intended sudo to work from an account that's in the local Administrators group, or the local Administrator account. Looks like I didn't handle the latter case though. Am I right to understand that your regular account is not in the local Administrators group, and your admin account is the actual built-in Administrator account? |
Yes, that is correct. |
Hmmm. If you're the Administrator then I would expect is_elevated on line 66 to return true and it should run your command. The only thing I can guess is that maybe it's something to do with being a domain admin, but not a local admin? Would you mind running this gist in powershell and sending me the output so I can try to reproduce the problem? You can run it quickly with iex (new-object net.webclient).downloadstring('https://gist.github.com/lukesampson/6725722/raw/sudo_diag.ps1') If you prefer not to put details here, my email is "me at lukesampson dot com". |
I've updated sudo with is_admin and is_elevated removed, so this should work for you now—you'd just need to run
|
Everything seems to work fine now. Thanks! For completeness, on my Win7 machine my admin account is not the default Administrator account. I had originally had trouble using scoop on my Win8 machine, though, but I suspect it's the same thing there. |
Great, glad it works now! Thanks for taking the time to look into it. Let me know if you find any more problems, but I'll close this one now. |
Based on your insight in #4, This should prevent problems caused by elevating to a different account with a different path variable. I've removed the warning against doing this when you install through scoop, since it's no longer possible. If you get a chance to confirm whether this works on your multicultural setup, I'd appreciate it! I.e. scoop update; scoop update sudo I did try installing another language pack, but apparently you need the Ultimate or Enterprise editions to do that :( |
Everything seems to be working fine. Thanks! |
I've realized the environment problem remains. I cannot run |
So is Or are you elevating using 'Run as administrator'? |
Yes, I didn't apply any special configuration, but I have two admin accounts and I can choose which one to use when elevating. I simply use |
Mentioned by @guillermooo in ScoopInstaller/Scoop#1
The text was updated successfully, but these errors were encountered: