delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/01/23:43:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <406CEF3E.9040002@pobox.com>
Date: Thu, 01 Apr 2004 23:42:38 -0500
From: Bill Smargiassi <bsmargiassi AT pobox DOT com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113
MIME-Version: 1.0
To: pvdabeel AT gentoo DOT org, cygwin AT cygwin DOT com
Subject: patch for keychain

--------------080404010106050709050007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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 AT pobox DOT com>

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


--------------080404010106050709050007
Content-Type: text/plain;
 name="keychain.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="keychain.diff"

--- /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.


--------------080404010106050709050007
Content-Type: text/plain; charset=us-ascii

--
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/
--------------080404010106050709050007--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019