Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 37618

Summary: KeyChain fails to detect existing ssh-agent where username is numeric
Product: Gentoo Hosted Projects Reporter: James Spinks <nu1dl5x02>
Component: KeychainAssignee: Keychain Team <keychain>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description James Spinks 2004-01-08 08:52:27 UTC
Using the KeyChain package from within Cygwin on a Windows XP Professional laptop.

Unfortunately, due to the build insisted upon by my employer, all the usernames in the organisation are six digit numbers.  When the keychain script attempts to check for existing ssh-agent instances the command 'ps -u 333333 -f' assumes that the numeric is not the actual username but the userid.  It cannot therefore find an existing ssh-agent instance and starts another one regardless.

I am able to work around this by changing the line in the script that sets the me variable from:

me=`whoami`

to:

me=`id -u`

This uses my actual userid instead of the numeric username and successfully performs the test for an existing ssh-agent.  I do not know how widely applicable this fix will be though outside of my Cygwin environment as I have no ability to test further.

Reproducible: Always
Steps to Reproduce:
1.  Create a user with a numeric username
2.  Run keychain
3.  Run keychain again

Actual Results:  
Keychain launches a new ssh-agent instance each time (and overwrites the
existing hostname-sh and hostname-csh files).
Comment 1 rob holland (RETIRED) gentoo-dev 2004-01-08 08:57:40 UTC
Valid linux username don't start with a number (for precisely this reason).
Comment 2 James Spinks 2004-01-08 09:02:36 UTC
Agreed, but this is Cygwin and not Linux.  Hence I'm stuck with the usernames that Cygwin inherits from Windows.