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-agent.plugin behaves weirdly → doesn't properly honour .gnupg/gpg-agent.conf #1741

Closed
nasenatmer opened this issue Apr 21, 2013 · 2 comments

Comments

@nasenatmer
Copy link

Hello,

just switching to oh-my-zsh since yesterday, I had to try out all the plugins relevant to me and stumbled over strange behaviour of the gpg-agent.plugin.

It seems to honour my $HOME/.gnupg/gnupg.conf file (change from pinentry-program /usr/bin/pinentry-gtk-2 to pinentry-program /usr/bin/pintentry-qt4 is effective), however, the settings max-cache-ttl 7200 and default-cache-ttl 7200 seem not to be honoured. Instead I'm being asked for the passphrase whenever opening an encrypted mair (even after only a few seconds)

Here's my gpg-agent.conf

# Cache settings (cache for 2 hours)
max-cache-ttl 7200
default-cache-ttl 7200

#Pinentry program setting   
pinentry-program /usr/bin/pinentry-gtk-2

# Environment file
write-env-file /home/jakob/.gnupg/gpg-agent.env

What works however…

Interestingly, if I start gpg-agent through a shellscript in /etc/profile.d, it works out nicely and gpg-agent remembers the passphrase for the set time. The gpg-agent.sh is taken from Archlinux Wiki and looks as follows:

#!/bin/sh

envfile="${HOME}/.gnupg/gpg-agent.env"
if test -f "$envfile" && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2)     2>/dev/null; then
    eval "$(cat "$envfile")"
else
    eval "$(gpg-agent --daemon --write-env-file "$envfile")"
fi
export GPG_AGENT_INFO  # the env file does not contain the export statement

Additionally to that, I've got the following two lines set in my .zshrc:

GPG_TTY=$(tty)
export GPG_TTY

Why could that be?

I have the impression that it has to do with the way how gpg-agent.sh exports stuff? Could that be? Has anybody else experienced similar problems?

@nasenatmer
Copy link
Author

Playing around with it more I found gpg-agent didn't ask for the the password every time when I started thunderbird from zsh. If however, I start thunderbird viadmenu_runor fromOpenBox menu` it asks me every time. So there clearly seems to be something wrong with the exporting of the variables.

@nasenatmer
Copy link
Author

Few, @fwalch helped me getting to grips with how variables work so I guess this issue can be closed then.

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

No branches or pull requests

1 participant