[pkg-gnupg-maint] Bug#851462: #851462 gpg-agent: a gpg-agent is already running - not starting a new one

Thomas Dickey dickey at his.com
Sun Feb 12 01:51:29 UTC 2017


It's broken, and recently.  I noticed this about a week ago.

On my machines, I mostly use ssh to connect, and have a script which
ties together gpg/ssh, using gpg-agent.  I do this to get the keys
for both in - package signing and network connections.

Here's the script:

#!/bin/sh
# $Id: wrapssh,v 1.9 2015/12/21 09:47:59 tom Exp $
# vi:ts=4 sw=4
# Initialize a subshell which will run ssh-agent, sets a variable that we can
# use in the initialization to force an ssh-add prompt.

unset SSH_AGENT_PID
unset SSH_AUTH_SOCK
unset SSH2_AUTH_SOCK
unset SSH2_AGENT_PID

if test -f /usr/bin/ssh-agent
then
	SSH_ADD="passphrase"
	export SSH_ADD
	if test -f /usr/bin/gpg-agent && test -f /usr/bin/pinentry-curses
	then
		killall gpg-agent 2>/dev/null
		ssh-agent presign
	else
		ssh-agent $SHELL
	fi
fi

...and it calls back with a new shell (tcsh in my case) to activate this:

if ( $?GPG_ADD ) then
	setenv GPG_TTY `tty`
	unsetenv GPG_ADD
	echo "GPG-signing on $GPG_TTY ..."
	if ( -e /usr/bin/gpg ) then
		echo | gpg -s >/dev/null
	else
		echo | gpg2 -s >/dev/null
	endif
	echo "...GPG-signing"
endif
if ( $?SSH_ADD ) then
	echo "prompt $SSH_ADD"
	unsetenv SSH_ADD
	ssh-add
endif

With the newly broken package, I don't get a gpg-prompt.  
Ditto for ssh-prompt.  What I get is this (turning on the trace):

~ (101) sh -x wrapssh
+ unset SSH_AGENT_PID
+ unset SSH_AUTH_SOCK
+ unset SSH2_AUTH_SOCK
+ unset SSH2_AGENT_PID
+ test -f /usr/bin/ssh-agent
+ SSH_ADD=passphrase
+ export SSH_ADD
+ test -f /usr/bin/gpg-agent
+ test -f /usr/bin/pinentry-curses
+ killall gpg-agent
+ ssh-agent presign
gpg-agent[1791]: reading options from '/users/tom/.gnupg/gpg-agent.conf'
gpg-agent[1791]: WARNING: "--write-env-file" is an obsolete option - it has no effect
gpg-agent[1791]: enabled debug flags: cache ipc
gpg-agent: a gpg-agent is already running - not starting a new one
gpg-agent: secmem usage: 0/65536 bytes in 0 blocks

By the way, I don't have a gpg-agent.conf (so that's another error).

Looks like the breakage occurred in
	gnupg-agent:amd64 (2.1.17-2, 2.1.18-3)

-- 
Thomas E. Dickey <dickey at invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnupg-maint/attachments/20170211/5d01bf63/attachment.sig>


More information about the pkg-gnupg-maint mailing list