fix(service/gpg-agent): ensure SSH_AUTH_SOCK is set on Darwin #7117
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit addresses #5997
At the root, the gpg-agent SSH integration is not working on Darwin
because shells are started with
SSH_AUTH_SOCK
already set to somethinglike
/private/tmp/com.apple.launchd.ozLmoURHDC/Listeners
, whichprevents the hook from setting the variable to the gpg-agent's socket.
This commit fixes the issue using a different mechanism to detect if the
current shell has already had the
SSH_AUTH_SOCK
variable set to thegpg-agent's socket, namely by checking for
gnupg_SSH_AUTH_SOCK_by
asdocumented in
https://www.gnupg.org/documentation/manuals/gnupg/Agent-Examples.html#Agent-Examples.
This is essentially a simplified version of
#5901 that does not
attempt to migrate gpg-agent over to launchd.
Signed-off-by: squat [email protected]