From 1702b37274ef51c10f23f6aa66ff05d000655779 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 18 Sep 2006 13:18:25 +0000 Subject: [PATCH] - gpg-agent-startup.sh: fix case where valid .gpg-agent-info exists --- gnupg2.spec | 9 +++++++-- gpg-agent-startup.sh | 13 +++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gnupg2.spec b/gnupg2.spec index dc1c90c..e7f734d 100644 --- a/gnupg2.spec +++ b/gnupg2.spec @@ -16,7 +16,7 @@ Summary: Utility for secure communication and data storage Name: gnupg2 Version: 1.9.22 -Release: 5%{?dist} +Release: 6%{?dist} License: GPL Group: Applications/System @@ -58,6 +58,8 @@ BuildRequires: docbook-utils BuildRequires: pcsc-lite-libs %endif +# sed/kill used in gpg-agent-(startup/shutdown).sh +Requires: fileutils util-linux Requires: pinentry >= 0.7.1 %if "%{?_enable_gpg:1}" == "1" @@ -170,7 +172,10 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Mon Sep 18 2006 Rex Dieter 1.9.22-5 +* Mon Sep 18 2006 Rex Dieter 1.9.22-7 +- gpg-agent-startup.sh: fix case where valid .gpg-agent-info exists + +* Mon Sep 18 2006 Rex Dieter 1.9.22-6 - fix "syntax error in gpg-agent-startup.sh" (#206887) * Thu Sep 07 2006 Rex Dieter 1.9.22-3 diff --git a/gpg-agent-startup.sh b/gpg-agent-startup.sh index 1533645..c9a7095 100755 --- a/gpg-agent-startup.sh +++ b/gpg-agent-startup.sh @@ -5,15 +5,16 @@ GPG_AGENT=/usr/bin/gpg-agent 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 - GPG_SOCKET=$(cat .gpg-agent-info |cut -f1 -d:) - if ! test -S "${GPG_SOCKET}" -o ! -O "${GPG_SOCKET}" ; then - rm -f ${HOME}/.gpg-agent-info 2>&1 >/dev/null + GPG_AGENT_INFO_FILE=${HOME}/.gpg-agent-info + if [ -f "${GPG_AGENT_INFO_FILE}" ]; then + GPG_SOCKET=$(cat "${GPG_AGENT_INFO_FILE}" | cut -f1 -d:) + if ! test -S "${GPG_SOCKET}" -a -O "${GPG_SOCKET}" ; then + rm -f "${GPG_AGENT_INFO_FILE}" 2>&1 >/dev/null fi fi - if [ -f ${HOME}/.gpg-agent-info ]; then - export GPG_AGENT_INFO=$(cat ${HOME}/.gpg-agent-info) + if [ -f "${GPG_AGENT_INFO_FILE}" ]; then + export GPG_AGENT_INFO=$(cat "${GPG_AGENT_INFO_FILE}") export GPG_TTY=$(tty) else eval "$(${GPG_AGENT} -s --daemon ${GPG_OPTIONS})"