diff --git a/gnupg2.spec b/gnupg2.spec index a7ef000..7ed679b 100644 --- a/gnupg2.spec +++ b/gnupg2.spec @@ -12,7 +12,7 @@ Summary: Utility for secure communication and data storage Name: gnupg2 Version: 1.9.21 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL Group: Applications/System @@ -163,6 +163,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jun 22 2006 Rex Dieter 1.9.21-3 +- fix "gpg-agent not restarted after kde session crash/killed (#196327) + * Thu Jun 22 2006 Rex Dieter 1.9.21-2 - 1.9.21 - omit gpg2 binary to address CVS-2006-3082 (#196190) diff --git a/gpg-agent-startup.sh b/gpg-agent-startup.sh index bddbd9d..b7a8ae9 100755 --- a/gpg-agent-startup.sh +++ b/gpg-agent-startup.sh @@ -3,11 +3,21 @@ GPG_AGENT=/usr/bin/gpg-agent ## Run gpg-agent only if not already running, and available if [ -z "${GPG_AGENT_INFO}" -a -x ${GPG_AGENT} ] ; then + + # check validity of GPG_SOCKET (in case of session crash) if [ -f ${HOME}/.gpg-agent-info ]; then - export GPG_AGENT_INFO=$(cat $HOME/.gpg-agent-info) + GPG_SOCKET=$(cat .gpg-agent-info |cut -f1 -d:) + if ! test -S ${GPG_SOCKET} -o ! test -O ${GPG_SOCKET} ; then + rm -f ${HOME}/.gpg-agent-info 2>&1 >/dev/null + fi + fi + + if [ -f ${HOME}/.gpg-agent-info ]; then + export GPG_AGENT_INFO=$(cat ${HOME}/.gpg-agent-info) export GPG_TTY=$(tty) else eval "$(${GPG_AGENT} -s --daemon ${GPG_OPTIONS})" - echo $GPG_AGENT_INFO > $HOME/.gpg-agent-info + echo ${GPG_AGENT_INFO} > ${HOME}/.gpg-agent-info fi + fi