X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=l7/iowCeYmHNtLqs5+2FHiZPVi3ShZ1i9BVJyelQ+Nt2GjAV5VAUu
	O68pGQKMoqvMbj8FocqZRtfCfUWlQ4twLHWonuNjw87tlmVJKMXt7AX46A7kZzVo
	XIx+XVlAZpMujlCv9uWD3aaPGtMGDxMK2scL6IFI5hSuaqRRJO5Su4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=ifQFBaQvcbFwzi3a3bcMQnf5Szc=; b=IZorM8TkC2uSzjNcG7ZYp+9oLmyW
	zW2hi/GAnK7f800GxeprJxlu00LcvANTvDgjVYAFzeqcZljJ4KrtbvvIONshTAPU
	nAK8vnib0iDth6JktWvKaJlmFC66WEHp4GKpE1ZcSG/ERKf6cmp937MtXucyxG9I
	uhmOJ0VRtaQV7P4=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: calimero.vinschen.de
Date: Fri, 17 Oct 2014 16:51:19 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Cannot exec() program outside of /bin if PATH is unset
Message-ID: <20141017145119.GT2681@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <571726.85545.bm@smtp112.sbc.mail.ne1.yahoo.com> <20141010103446.GJ2681@calimero.vinschen.de> <CAO1jNwt5UyB9CDKJdotXUND--mg1sY-5Fu+-ZHf2atM5_=HArA@mail.gmail.com> <CAMCbSMrar1Zu4p6gN=gc8-XqE-8RUTmP3er0ujeN--CHKzCNAQ@mail.gmail.com> <816144.8551.bm@smtp119.sbc.mail.ne1.yahoo.com> <CAMCbSMpWKbSVhVu85_02fN3sgWXiFBkUzjOOAJ6+Jxot8X6E=Q@mail.gmail.com> <20141010153925.GL2681@calimero.vinschen.de> <20141014193045.GF2681@calimero.vinschen.de> <54403DCD.7090107@t-online.de> <20141017091025.GA10087@calimero.vinschen.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;	protocol="application/pgp-signature"; boundary="qfY6YPPgxDuMl8bl"
Content-Disposition: inline
In-Reply-To: <20141017091025.GA10087@calimero.vinschen.de>
User-Agent: Mutt/1.5.23 (2014-03-12)

--qfY6YPPgxDuMl8bl
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Oct 17 11:10, Corinna Vinschen wrote:
> On Oct 16 23:51, Christian Franke wrote:
> > Corinna Vinschen wrote:
> > >...
> > >I implemented this in the latest snapshot.  It calls SetDllDirectory
> > >on Cygwin's /bin, and dlopen addiotnally tries to load the DLL with
> > >LoadLibraryEx(LOAD_WITH_ALTERED_SEARCH_PATH) if all else failed.
> >=20
> > For some reason, the SetDllDirectory() call has no effect for exec():
> >=20
> > Testcase:
> >=20
> > $ unset PATH
> >=20
> > $ uname -srvm
> > -bash: uname: No such file or directory
> >=20
> > $ /bin/uname -srvm
> > CYGWIN_NT-6.1-WOW64 1.7.33s(0.277/5/3) 20141014 19:44:03 i686
> >=20
> > $ /usr/sbin/alternatives
> > /usr/sbin/alternatives: error while loading shared libraries: ?: cannot=
 open
> > shared object file: No such file or directory
>=20
> Weird.  The same sequence of commands works fine for me on W8,
> W8.1 and W10 64 bit, under i686 as well as x86_64 Cygwin.=20=20
>=20
> [...]
>=20
> but it doesn't on Vista and W7, wow.
>=20
> The question now is, is it because the path given to SetDllDirectory
> is not propagated to child processes on older systems, or is it
> because the directory is only used in calls to LoadLibrary{Ex} on
> older systems.
>=20
> Stay tuned, I have to investigate this.

Ok, so prior to W8, the SetDllDirectory path is not propagated to child
processes :-|

I created a patch and a new snapshot on https://cygwin.com/snapshots/
which calls SetDllDirectory during initialization of every process.
Please give it a try.


Thanks,
Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--qfY6YPPgxDuMl8bl
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJUQSznAAoJEPU2Bp2uRE+gnCkP/AwJhtMq0hnnD0Wdl0XQY3Kb
SEQLgoe4T3ykDePM4CADD0IpjW0pNCkzBhExSfj3SYDifPEKwtayaGCuv5BMcWHR
6KYkWNGJMwa8IgFf0C35j+9H43gGabGU4FKLGuWKxt3Hq+qPvFBGFlKm+7ZYtHbF
Y+3jbB5WLlsR0454jCKiYhv1b9RPwTfMjOG9FjlAuEvQPUiYH86HcTdXj9Pl8n2/
z1PWdEw0o8I/HfdKeho06Na7e7Zs968qIbXz+DOjniiNoWnp7xRrFN/XBWi+w147
Q60aSaPPqS/07CAd74VNpGy2ib+v+OCM6pPY/+NAS2lyd4cBwTU6k8+GEDQqFtJk
JiLAdYEAhgPIwtgJcHk3I7X6vjvtAElczARKzJinEOipgGVy+RsK2KBOIHxaPCia
08hzh2InuDi1RVQd+QNetzgsGH1ZZIc8jMhWlwOnPHHnjyBVi50Lcrb89/daoZj1
lx0klTiQ5rKOav150B0hmeOEQfK6HKvW9L9khb2QT6zU6tq4OHGHxC0rMswe43yo
D1+7aFBYYVRYYHLudJ/p0QQgemec9tFYXGPtv0lNZiSsGUCeJRmB7K/mZg8gTahR
PPhTSif/sk4cRPZJh85MJorpDQ5kTcv9MW2wZ/Kw6Sy2BHOuoGLt/DGPshm5JUWv
JQOGE8FebT8sdIifOsQL
=RYKb
-----END PGP SIGNATURE-----

--qfY6YPPgxDuMl8bl--
