From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11691 invoked by alias); 17 Oct 2014 09:10:34 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 11674 invoked by uid 89); 17 Oct 2014 09:10:29 -0000 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 Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Oct 2014 09:10:28 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 904BE8E14F0; Fri, 17 Oct 2014 11:10:25 +0200 (CEST) Date: Fri, 17 Oct 2014 09:10:00 -0000 From: Corinna Vinschen 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> <816144.8551.bm@smtp119.sbc.mail.ne1.yahoo.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) X-SW-Source: 2014-10/txt/msg00211.txt.bz2 --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1307 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 Content-length: 819 -----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--