-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Include SSH_AUTH_SOCK in filtered environment #3493
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
Conversation
|
Neat, I didn't know about Although, it is weird that I cannot reproduce this if I'm using the same config. Does this only happen if you haven't called |
|
@reitermarkus No, my keys were already added to the agent but the errors still occurred on both machines I tried it on. So when you tried to reproduce you had |
Yes, seems like |
|
Also, I'm not sure this is configuration we want to allow, anyway. I'm going to investigate how to have Homebrew's |
|
@reitermarkus Do you have an unencrypted key (that's authorized on GitHub) at a standard location like @MikeMcQuaid Why is that? |
You don't need SSH authentication to access public GitHub repositories. That we use Git for our update mechanism is an implementation detail that we don't want to allow user configuration of (because user custom configuration breaks things; here is an example where your configuration has broken things, for instance). This isn't too bad when users know what has broken it but often people will copy-paste to |
My |
|
@Noctem, can you try if changing https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/update.sh#L22 to env HOME=/dev/null "$GIT_EXECUTABLE" "$@"works? |
Weird. I don't know how it works for you then, maybe I'll take a look at the git source code to see how it finds keys. Does it ask for a password to decrypt your key while it updates?
I understand, and I sympathize with having to deal with support requests resulting from misconfiguration. I just prefer using SSH whenever possible, and I previously forgot to mention the more justifiable use-case of having private taps which require SSH access (which also applies to me, as mentioned above). If you do end up ignoring users' |
Include SSH_AUTH_SOCK (if set) in the filtered environment to avoid SSH issues with git.
|
I'm convinced, thanks again for your contribution, @Noctem! |
brew testswith your changes locally?So my situation may not be very common, but
brew updatebroke for me after b26a0d4 because I have the following in my .gitconfig:which forces all GitHub connections to use SSH. With
SSH_AUTH_SOCKremoved from the environment git is no longer able to find my SSH agent and I get:for each of my taps. Copying
SSH_AUTH_SOCKinto the filtered environment fixed the problem.Fixes #3503