Bug#502468: keychain: always starts a new ssh-agent with --inherit any and SSH_AUTH_SOCK not set

2023-01-06 Thread Peter Pentchev
On Thu, Oct 16, 2008 at 02:09:30PM -0400, Andrew Schulman wrote:
> Package: keychain
> Version: 2.6.8-2
> Severity: normal
> 
> 
> When SSH_AUTH_SOCK is not set, keychain --inherit any never finds
> an existing ssh-agent.  It always starts a new one:
> 
> $ echo $SSH_AUTH_SOCK
> $ cat .keychain/helium-sh
> SSH_AUTH_SOCK=/tmp/ssh-AeUWcuq462/agent.462; export SSH_AUTH_SOCK;
> SSH_AGENT_PID=463; export SSH_AGENT_PID;
> $ pgrep -U andrex ssh-agent
> 463
> $ keychain --inherit any

Hi,

I'm sorry for not replying to this bug report earlier when I adopted
the Debian package of keychain. Also, yeah, I realize that the bug
report was filed a long time ago and you may have moved on.

Still... are you sure that `--inherit any` is what you want to use in
this case? Would `--inherit any-once` not be better? When I try
running keychain after a ~/.keychain/-sh file has already
been created, `--inherit any-once` looks at the file and uses
the already running SSH agent.

Again, sorry for not replying sooner!

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Bug#502468: keychain: always starts a new ssh-agent with --inherit any and SSH_AUTH_SOCK not set

2008-10-16 Thread Andrew Schulman
Package: keychain
Version: 2.6.8-2
Severity: normal


When SSH_AUTH_SOCK is not set, keychain --inherit any never finds
an existing ssh-agent.  It always starts a new one:

$ echo $SSH_AUTH_SOCK
$ cat .keychain/helium-sh
SSH_AUTH_SOCK=/tmp/ssh-AeUWcuq462/agent.462; export SSH_AUTH_SOCK;
SSH_AGENT_PID=463; export SSH_AGENT_PID;
$ pgrep -U andrex ssh-agent
463
$ keychain --inherit any

KeyChain 2.6.8; http://www.gentoo.org/proj/en/keychain/
Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL

 * Initializing /home/andrex/.keychain/helium-sh file...
 * Initializing /home/andrex/.keychain/helium-csh file...
 * Initializing /home/andrex/.keychain/helium-fish file...
 * Starting ssh-agent
 * Inheriting gpg-agent (32013)
 * Initializing /home/andrex/.keychain/helium-sh-gpg file...
 * Initializing /home/andrex/.keychain/helium-csh-gpg file...
 * Initializing /home/andrex/.keychain/helium-fish-gpg file...

$ pgrep -U andrex ssh-agent
463
872

In this case keychain should have found the existing ssh-agent, but
instead it started a new one.

Note that if SSH_AUTH_SOCK is set, then keychain --inherit any does
the right thing and inherits the socket for the existing agent.

Similarly, keychain --inherit any will start a new gpg-agent even if
one is already running, if GPG_AGENT_INFO is unset.

For now, the workaround is to use keychain --inherit any-once, which
works as described in the man page, although it's not exactly what I
want.

Thanks,
Andrew.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (300, 'unstable'), (200, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1) (ignored: LC_ALL set to 
en_US)
Shell: /bin/sh linked to /bin/bash

Versions of packages keychain depends on:
ii  grep2.5.3~dfsg-6 GNU grep, egrep and fgrep
ii  openssh-client [ssh-client] 1:5.1p1-3secure shell client, an rlogin/rsh

keychain recommends no packages.

Versions of packages keychain suggests:
ii  gnupg-agent   2.0.9-3.1  GNU privacy guard - password agent
pn  ssh-askpass   none (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]