X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
Message-ID: <4C6C2CAB.4030507@cwilson.fastmail.fm>
Date: Wed, 18 Aug 2010 14:55:39 -0400
From: Charles Wilson <cygwin@cwilson.fastmail.fm>
Reply-To: Charles Wilson <cygwin@cwilson.fastmail.fm>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: "run" changes behavior with cygwin-17.6
References: <380-220108318145158645@cantv.net>	<20100818150920.GY11340@calimero.vinschen.de>	<4C6C1490.3040202@cwilson.fastmail.fm>	<4C6C1582.1080801@acm.org> <AANLkTikHTN602m6_uoCgbx71NRt-Vqc6XjQizWTx6Lfv@mail.gmail.com>
In-Reply-To: <AANLkTikHTN602m6_uoCgbx71NRt-Vqc6XjQizWTx6Lfv@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 8/18/2010 2:25 PM, Andy Koppe wrote:
> Ouch. This might affect even more cygutils. We really should have
> thought of that.
>
> At least there aren't any chdir() calls in any of the cygutils, so it
> should primarily be a question of setting the Win32 current directory
> in line with the POSIX one at startup, in any of the utils that may
> invoke a Win32 function with a relative path. Chuck, do you need a
> hand with going through them?

Oh, riiiiight.

The problem is this: since the win32 CWD is *always* bogus, it is 
possible that other win32 functions will croak, not just CreateProcess. 
  So, there are a number of native win32 calls in the cygutils tools, like:

cygstart: CreateProcess, among others
lpr: ...many...
putclip/getclip: GetClipboardData, SetClipboardData, etc

Now, I haven't tested each of these tools exhaustively under 
cygwin-1.7.6, so I'm not sure the bogus win32 cwd affects them (except 
obviously cygstart).  But...by their very nature many of these tools use 
the native w32api.  So...each should probably take care to set the win32 
cwd if at all possible.


Yeah, patches would be great.

--
Chuck

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

