From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17881 invoked by alias); 17 Oct 2014 18:20:19 -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 17869 invoked by uid 89); 17 Oct 2014 18:20:18 -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 18:20:17 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 8B2AD8E14F0; Fri, 17 Oct 2014 20:20:15 +0200 (CEST) Date: Fri, 17 Oct 2014 18:20:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Cannot exec() program outside of /bin if PATH is unset Message-ID: <20141017182015.GU2681@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <816144.8551.bm@smtp119.sbc.mail.ne1.yahoo.com> <20141010153925.GL2681@calimero.vinschen.de> <20141014193045.GF2681@calimero.vinschen.de> <54403DCD.7090107@t-online.de> <20141017091025.GA10087@calimero.vinschen.de> <20141017145119.GT2681@calimero.vinschen.de> <54415863.20702@t-online.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="obRs6g3QSNdgmoVb" Content-Disposition: inline In-Reply-To: <54415863.20702@t-online.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2014-10/txt/msg00231.txt.bz2 --obRs6g3QSNdgmoVb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1925 On Oct 17 19:56, Christian Franke wrote: > Corinna Vinschen wrote: > >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. > >>>For some reason, the SetDllDirectory() call has no effect for exec(): > >>> > >>>Testcase: > >>> > >>>$ unset PATH > >>> > >>>$ uname -srvm > >>>-bash: uname: No such file or directory > >>> > >>>$ /bin/uname -srvm > >>>CYGWIN_NT-6.1-WOW64 1.7.33s(0.277/5/3) 20141014 19:44:03 i686 > >>> > >>>$ /usr/sbin/alternatives > >>>/usr/sbin/alternatives: error while loading shared libraries: ?: canno= t open > >>>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. > >> > >>[...] > >> > >>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. > >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. >=20 > Now works. >=20 > cygwin_patches_for_postfix_count++; postfix_patches_for_cygwin_count--; := -) You seem to like the idea... ;) Thanks for testing, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --obRs6g3QSNdgmoVb Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUQV3fAAoJEPU2Bp2uRE+g16MQAJ5fQKUdUoffAflztLFRdqsn 8bE9HuAB3d9JcFrp7Y2r2FglrbRFxJBW4P4Jwk9nuhsEFhlIbhVa+lzYx0hf0Wuk nHLenVeAEJuX1sBxQ2wJKUOj3yvddhDFfbovsPChZpoMGrgtLBz+pUtNqGlAqq9P W5pattNg/ftBEBL/p2zQLsj+ZNNuHg5foqbY3vWrjVlNLEwk4JCj1C/TY7ulYTHh NQbiEq/Oyf8s0hAGoHJDXSEzz2uiExOM9wNGoAxxTfgF8B/UHvveN5dgfBc+otOn CNFmS6a1eUL3U+PlT4jKuEhKstCJRVP8SwOSngmwiJL251C9q8OqzeboFBvVhdR+ KwYg6wRz/Xqj4cT56HdsYFZtD8f/4k18HsIpLvq3P+WyDt1Wgf7DvX1C9XrpF4PY IXFZXUx15S+UJIlYBSzTyJSA3HTJIrG9/pPVq/5mtKvY4yuwBogTb56Nel1RUQFy e1y+liNPYjRJns6xq9OTcZiti8L+wuH2wXBZRV3RP83zZA9JU6saveGPpPVCeDyZ iVoHWofHm/cc20MuCvTaHti44ikX6iVkSVGOBYl7YJ9zDCN8SWo9x/Irc5IbjmyM 9VOt5arFtEyipOQZIKAIZ8TX9ZvAbR22lvGR3mb8DvVpK99igfurlGBEfWRP1CYm W0za4PLzOWa5bEbVV87L =hMo1 -----END PGP SIGNATURE----- --obRs6g3QSNdgmoVb--