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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=bKX4kNb9R3O0gvJvonBUen2EM5m+73AWKFdmlVpTS2j R/BK3/IT1NuXv0Pi9QpufhIYcpOub6zqZnk8gNud055wuG+nCR1ZosvG5usixh9g QLwfweKlhy+QjzdeO0a4Blpv9+izHa5qRExXW8k5/KWd4TqGHY66F3IZRSNbvhXQ = 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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=OLncVeh5LUMhJ9vQ1TCFxLqT25w=; b=BFg9d7qi7lV48HRvq c5A+AnVLxLdjveCXF/i016XuyjvAzrJjUW6hmezzOQ2QMWm/IKAiRuooFnO5iCsB 1H1SjFzW36UP5WLK6lDlZ/QUY8jdXs0USWC+IJiurGEvk0UkZOs9qaFKXZx7T5xd kMiiYby1t1UUxMKD2YrJdnEgRw= 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=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailout07.t-online.de Message-ID: <54415863.20702@t-online.de> Date: Fri, 17 Oct 2014 19:56:51 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Cannot exec() program outside of /bin if PATH is unset References: <571726 DOT 85545 DOT bm AT smtp112 DOT sbc DOT mail DOT ne1 DOT yahoo DOT com> <20141010103446 DOT GJ2681 AT calimero DOT vinschen DOT de> <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> In-Reply-To: <20141017145119.GT2681@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: ?: cannot 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. Now works. cygwin_patches_for_postfix_count++; postfix_patches_for_cygwin_count--; :-) Thanks, Christian -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple