This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [Patch] "strace ./app.exe" probably runs application from /bin
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Sat, 2 Jun 2007 11:41:56 -0400
- Subject: Re: [Patch] "strace ./app.exe" probably runs application from /bin
- References: <466183F3.5020900@t-online.de>
- Reply-to: cygwin-patches at cygwin dot com
On Sat, Jun 02, 2007 at 04:51:31PM +0200, Christian Franke wrote:
>Running an application with strace from current directory may not work
>as expected.
>The "./" is not passed to CreateProcess() and the default app search
>rules apply
>(1. strace.exe directory, 2. cwd, ..., 6. PATH)
>
>Therefore, an old version of the same app already installed in /bin may
>be run instead.
>
>
>Testcase:
>
>$ cd /tmp
>
>$ cp /bin/date.exe ./uname.exe
>
>$ date
>Sat Jun 2 16:34:23 2007
>
>$ uname
>CYGWIN_NT-5.1
>
>$ ./uname
>Sat Jun 2 16:34:24 2007
>
>$ strace -o nul ./uname
>CYGWIN_NT-5.1
>
>Workaround:
>
>$ strace -o nul ././uname
>Sat Jun 2 16:34:25 2007
>
>
>The attached patch should fix this.
>
>2007-06-02 Christian Franke <franke@computer.org>
>
> * strace.cc (create_child): Don't remove current directory
> from application path.
Thanks for the problem report and test case but this is pretty clearly
not the right way to deal with the issue. Putting a special case catch
of "./" around a function call which is intended to deal with paths is
pretty clearly a band-aid.
Let me rephrase the problem:
"cygpath does not properly deal with the current directory"
Thanks for the patch but we won't be applying it in this form.
cgf