X-Recipient: archive-cygwin AT delorie DOT 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=xLxPpnIHZS2ocdiV22CCNbX0f5iyy+VD6g3dM0QRjOErbWMtqm3cN 061SE2YACL5n8iHheu3F1x1Ndb8Hj763xVQ3k5pOuc1t+wolPjM88CtWzR35L92J bXY+iPh70I/QsiAui7AA4nwKp1Cvk/IJwsqX8PEa4rKh7qDNq3u6yw= 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=V6533EoNfKi2pLqlaO/Exo2eg6U=; b=a75wUg7BBAQDV5Locrry2rp1sqna vUm5GqnfhQWgobrU1zTU7v4GmUzYI4FAzZx9nSYj7mjmdvnCNZOq0oGAhwgf4LqZ bCNDAHEXZ7xgl60HvXwRiiMMmImZsqoFbA2Y2RDxecHSNup7uAYGiJecsNrtn6EI L17u6GZHu8HF6B4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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 20:20:15 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Cannot exec() program outside of /bin if PATH is unset Message-ID: <20141017182015.GU2681@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <816144 DOT 8551 DOT bm AT smtp119 DOT sbc DOT mail DOT ne1 DOT yahoo DOT com> <20141010153925 DOT GL2681 AT calimero DOT vinschen DOT de> <20141014193045 DOT GF2681 AT calimero DOT vinschen DOT de> <54403DCD DOT 7090107 AT t-online DOT de> <20141017091025 DOT GA10087 AT calimero DOT vinschen DOT de> <20141017145119 DOT GT2681 AT calimero DOT vinschen DOT de> <54415863 DOT 20702 AT t-online DOT 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) --obRs6g3QSNdgmoVb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 -----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--