-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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 timestamp reset may break scripts #17912
Comments
This recent PR introduced the new behavior. #17694 |
Duplicate of #17905, WONTFIX sorry. |
I understand the reason for the change. However, IMO this new behavior is an overreach.
|
@bhavanki If you can provide details (ideally a pull request) for how this is technically possible: we'd love that. We haven't been able to figure out how to do this yet.
Almost all executions of Homebrew (not just installs) may require reading potentially untrusted Ruby code. It's hard to scope this much more tightly than it is currently, unfortunately. |
Thanks for continuing the conversation.
Yeah, I doubt access can be restored (especially if you all haven't discovered how to). With some further experimenting, I did find a workaround for leaving access in place. It works because This Stack Overflow answer proposes using the
(This is for macOS. Also, the I don't imagine that this exact mechanism could work in And, just for completeness: Ansible lets you supply a "become" password which is equivalent to prompting for sudo. It's an extra prompt for the user, but lets Ansible run steps requiring sudo without requiring it to be established ahead of time. It's probably the "right" way anyway.
Ah, understood, that's too bad! |
Thanks @bhavanki! |
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
Run
brew
commands within a script that has acquired sudo access and expects to keep it throughout execution.What happened (include all command output)?
After using brew, the script proceeded to run additional commands under
sudo
, and I was prompted again for a password.Eventually, the script called Ansible to execute a playbook on the local machine. The first task step that required sudo access failed, because there was no terminal to get a password from.
Even after ensuring that Ansible was called with sudo, that access was lost after a step in the playbook called
brew
to install a missing formula. The next step that required sudo failed in the same fashion.What did you expect to happen?
For the script to execute to completion, with sudo access available for all script commands (and Ansible steps) following execution of
brew
.Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: