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

gpg module fix: already running #1

Merged
merged 7 commits into from
Apr 7, 2022

Conversation

Shea690901
Copy link
Owner

Fixes sorin-ionescu#1681, sorin-ionescu#1164

Proposed Changes

  • gpg module: Use gpgconf to get gpg-agent path instead of using environment variables and a fixed path by default, which is more compatible. For example: gpg has been started by systemd, and the sockets is set by sockets.target which is different from the default path ~/.gnugp/S.gpg-agent and no environment variable is set for current shell, but gpgconf can find the correct socket file and using it to check whether gpg-agent is already run. Otherwise, prezto will prompt gpg-agent: a gpg-agent is already running - not starting a new one at startup and it don't pick up the correct gpg-agent socket.
  • ssh module: remove re-export SSH_AUTH_SOCK in ssh module. Becasue some tools such as pam ssh auth will check socket file's permission. A link to this socket is useful but re-export the variable will break some tools.

@Shea690901 Shea690901 merged commit 4b02926 into Shea690901:master Apr 7, 2022
# Start gpg-agent if not started.
if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then
if [[ -z "$GPG_AGENT_INFO" && ! -S ${_gpg_agent_socket}" ]]; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're missing a double quote around _gpg_agent_socket

Copy link

@tigerkzr tigerkzr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes successfully removed the "gpg-agent already running" warning. Just don't forget that missing double quote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants