Changes in process spawning break perl system() function

LRN lrn1986@gmail.com
Tue Mar 17 04:52:00 GMT 2015


How to reproduce:
1) create a shell script (say, /usr/bin/shellscript) containing this:

#!/bin/sh
echo ${0##*/}

2) create a symlink (say, /usr/bin/asymlink) that points to shellscript

3) create a perl script (say, /usr/bin/perlscript) containing this:

#! /usr/bin/perl -w
system '/usr/bin/asymlink';

4) run /usr/bin/perlscript

Expected results:
"asymlink" should be echoed by the shellscript when it is run by perlscript

Actual results:
"shellscript" is echoed instead

This affects 1.7.35.

I've tried various cygwin dll snapshots, everything is fine (symlink name is
echoed) with cygwin1-20150210.dll, cygwin1-20150211.dll breaks things first (a
full DOS path to shellscript is echoed), then from cygwin1-20150215.dll and
onward the target script name is echoed, as described above.

Symlink can be a Cygwin symlink or a native symlink, doesn't matter.

The use-case for this is autoconf wrapper (a shell script) that is being run by
autoreconf (a perl script) and uses the contents of $0 to find different
versions of autoconf, expecting $0 to be something like /usr/bin/autoconf, but
getting things like /usr/share/autotools/ac-wrapper.sh instead.

-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x922360B0.asc
Type: application/pgp-keys
Size: 1717 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150317/59764c7b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150317/59764c7b/attachment.sig>


More information about the Cygwin mailing list