- fix "gpg-agent not restarted after kde session crash/killed (#196327)

This commit is contained in:
Rex Dieter 2006-06-22 16:38:21 +00:00
parent c22bdac211
commit 59c6a38829
2 changed files with 16 additions and 3 deletions

View File

@ -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 <rexdieter[AT]users.sf.net> 1.9.21-3
- fix "gpg-agent not restarted after kde session crash/killed (#196327)
* Thu Jun 22 2006 Rex Dieter <rexdieter[AT]users.sf.net> 1.9.21-2
- 1.9.21
- omit gpg2 binary to address CVS-2006-3082 (#196190)

View File

@ -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