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=jVkN9wUMIO+Cp4dovM+Vtt5RMKpe2Cb1Yvprur3ssU1uctFFrFalg
	4SaNRQO4rfQYLr6QZ57Rv0JG86J5QjUlPLZdxs33uj1bsWHdnHGxyEsqjgcOdabd
	DkagzCnyYtAFPMSgUX/4DjyEvL+TUWVnbQNdbae6iIDDJ5xxogFY+M=
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=hcwLG4TgpwqJxmQ2dJOIngnlE70=; b=qu6UrO/8ZlthOMjkePmUTjkR4zsE
	Sm3S1mDwknBOCyQ7Ev3cNsvY/kjY+kyzIOIpHuZ2znIrQ08bIikVtZ9RW40yuH8c
	U1EnU4EoAgm1ALV9CsB19mIsLTRsCZmy7bpHY4qH8+dAfiqVcjElL2volpIaOT56
	CChvxuvYUepnFdo=
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 11:10:25 +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: <20141017091025.GA10087@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20141009162906.GA25389@calimero.vinschen.de> <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>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;	protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi"
Content-Disposition: inline
In-Reply-To: <54403DCD.7090107@t-online.de>
User-Agent: Mutt/1.5.23 (2014-03-12)

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

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 o=
pen
> shared object file: No such file or directory

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

[...]

but it doesn't on Vista and W7, wow.

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.

Stay tuned, I have to investigate this.


Thanks,
Corinna

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

--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature

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

iQIcBAEBAgAGBQJUQN0BAAoJEPU2Bp2uRE+gt6YQAKC0FQoTBxJP77COl42OJOlY
1tSt1v2F2vqjqxHRZ2W7gLp/CcXBzJdROVewYrsQCcHNgxK+jUjbjWMYKW0aQ7De
2PLmK034Pesel9hpcHKe71JS2L7UNassCHOEyfuKoNJ/ySY7FYTJUqjcjiq7m4AR
g1hGuAcMN1I3UmrnWxdERSISPSMNoVE+UWs4vojR9F7zw291k7w4WXyqlAJ03Hhf
g7yNXtEqBHuI4Zq/MM7il13EChfzb9KP6AM0TziRAmT9q3EtXa4C8vBi8SlsFLLp
xk5GU4Ui38/BZntZRBZROxBjNc9KKn1X9ifQKVHM8tOu2wIddre6mo/KDEdMN8YG
DZtF7RYTELocetSQmAW7ASMna9koOEuq2w3k3vUpvJqK5ZgSU/dVeorrAw6ifAu/
tccozW+bP40PeSo8u7PJ2sX7O9WqVbubfo/lVgsEt/Pd8OGohTXm55czQuIoxikJ
ZTuomnxsJE9BgoneEAz4CNTuOk0qd0jPzOLiqJqF+jhMJO6pauM/iyrdFgQAEUot
RoMB0kpuA/03a5vmi1/LL8ofhbfVyv8b1PnhtDmb/R8NcdKP+cv8YzxoEKiWgQvz
IVYMmwxlqbzaxYcnlk+xyjIJSUiOg89JaXZlcGhCniseXNDME+VHcdWpQl4A8pLJ
FAQk1Wf61xEmkWtNndAG
=HAlq
-----END PGP SIGNATURE-----

--6c2NcOVqGQ03X4Wi--
