Skip to content
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 access proposed changes #10521

Closed
anantshri opened this issue Apr 10, 2015 · 7 comments
Closed

sudo access proposed changes #10521

anantshri opened this issue Apr 10, 2015 · 7 comments

Comments

@anantshri
Copy link
Contributor

Issue raised earlier in homebrew but as suggested by homebrew folks Homebrew/legacy-homebrew#38509 raising issue here.

I have a setup where the user with brew setup doesn't have sudo access. While mac takes it gracefully by allowing a username as well as password prompt, brew assumes that sudo is enabled for user and the step fails after a long download of file.

Here are two options i am suggesting.

  1. We check for sudo access before hand or via variable and don't download the file if sudo is needed when user does'nt have sudo access.
  2. find a way to prompt a username and password to use for privilege elevation.

example if you install say virtualbox via brew then it need to install a couple of drivers which require them to have sudo access or i suppose any .pkg file is executed via installer with sudo permission. I hope this makes it a bit more clear. thats where we can make a check if the user doesn't have sudo why bother downloading the package. its just a waste of bandwidth and extra time.

@radeksimko
Copy link
Contributor

Hi!
We're aware of this problem, and the issue below is the beginning of a possible solution:
#8819

Once we have the data about each cask, we could add something like --fail-without-su-perms (I believe someone will come up with better name) which will print an error message instead of downloading the cask?

e.g.

$ brew cask install virtualbox --fail-without-su-perms
Can't install virtualbox, su perms needed.

What do you think?

@radeksimko radeksimko added enhancement discussion core Issue with Homebrew itself rather than with a specific cask. labels Apr 10, 2015
@anantshri
Copy link
Contributor Author

why not inverted behaviour.

ie. we internally check if user has sudo access if not just print message that the cask need sudo not downloading.

Or we can investigate a possibility of asking user credentials simmilar to how osx ask's both username and password. and see if we can use those to perform installation. But in that case managing uninstall will be a big pain of its own.

@vitorgalvao
Copy link
Member

we can investigate a possibility of asking user credentials simmilar to how osx ask's both username and password.

That’s easy to do but calls a GUI — which breaks automation — so it’s a no-go.

I agree with not needing a flag to specify this behaviour; it should work by default.

@anantshri
Copy link
Contributor Author

I can understand the part about GUI and automation stuff and suggested only as a last alternative.

@radeksimko
Copy link
Contributor

Or we can investigate a possibility of asking user credentials simmilar to how osx ask's both username and password.

That's basically what we do already, even though it's just a side-effect of 3rd party tools we use as those require su perms (typically install for pkgs).

Also it's worth pointing out that "sudo perms" is a relative term, because it really depends what you, as a user have access to. Some things are obvious, but some are not.

e.g. imagine a situation when /Applications/ has ownership your-username:staff and privileges rwx/rwx/---, so even though you're not su, you can install apps to /Applications because you're part of staff group. You may not be able to run install *.pkg though.

@vitorgalvao
Copy link
Member

You example is a good point. Guess we might need that flag after all.

@vitorgalvao
Copy link
Member

Seems like there isn’t much interest in this for now. With so much more stuff with higher priorities, I’ll close it. We can always revisit this later.

@miccal miccal removed core Issue with Homebrew itself rather than with a specific cask. discussion enhancement labels Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants