This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch for keychain


I noticed this with a recent Cygwin install. $HOME was set to my user dir in C:\Documents and Settings. Several of the tests on $keydir and $pidf were not quoted and the spaces in $HOME were causing "too many arguments" errors. As a result, the agent info was not stored properly and closing the shell that started keychain would result in a hung cmd.exe or rxvt.exe. So far things are working as they should after these changes to quote variables in 3 tests and a "." sourcing of $pidf.

The attached diff was generated against Cygwin's 2.0.3-2 package. I looked at patching against the 2.0.3 source linked on the keychain home page, but that had a 1 line change, having a -e argument to ps on line 253. I recently saw where that was patched out.

This isn't really a problem with Cygwin. Any home dir with spaces in it would cause issues. It's just more likely to occur on Cygwin.

bill

ChangeLog entry:

2004-04-01 Bill Smargiassi <bsmargiassi@pobox.com>

* keychain: Add quotes to tests on $keydir and $pidf, and one source of $pidf.

--- /usr/bin/keychain.orig	2003-12-04 01:39:05.001000000 -0500
+++ keychain	2004-04-01 21:05:04.832580800 -0500
@@ -219,12 +219,12 @@
 cshpidf="${keydir}/${hostname}-csh"
 lockf="${keydir}/${hostname}-lock"
 
-if [ -f ${keydir} ]
+if [ -f "${keydir}" ]
 then
 	echo "$0: ${keydir} is a file (it should be a directory;) please fix."
 	exit 1
 #Solaris 9 doesn't have -e; using -d....
-elif [ ! -d ${keydir} ]
+elif [ ! -d "${keydir}" ]
 then
 	mkdir ${keydir} || exit 1
 	chmod 0700 ${keydir}
@@ -301,9 +301,9 @@
 fi
 
 SSH_AGENT_PID="NULL"
-if [ -f $pidf ]
+if [ -f "$pidf" ]
 then
-	. $pidf	
+	. "$pidf"	
 fi
 
 # Copy application-specific environment variables into generic local variables.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]