public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Cannot exec() program outside of /bin if PATH is unset
Date: Fri, 17 Oct 2014 09:10:00 -0000	[thread overview]
Message-ID: <20141017091025.GA10087@calimero.vinschen.de> (raw)
In-Reply-To: <54403DCD.7090107@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]

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.


Thanks,
Corinna

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

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-10-17  9:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 18:02 Christian Franke
2014-09-12 19:39 ` Eric Blake
2014-09-12 21:14   ` Christian Franke
2014-09-12 21:56     ` Andrey Repin
2014-09-12 23:04       ` Christian Franke
2014-09-12 23:06         ` Eric Blake
2014-09-12 23:13           ` Eric Blake
2014-09-13 16:17             ` Christian Franke
2014-09-15  7:47               ` Peter Rosin
2014-09-15  9:28                 ` Peter Rosin
2014-09-15 17:16                 ` Christian Franke
2014-10-08 13:41                   ` Corinna Vinschen
2014-10-08 17:16                     ` Christian Franke
2014-10-09 10:03                       ` Corinna Vinschen
2014-10-09 14:25                         ` Eric Blake
2014-10-09 16:29                           ` Corinna Vinschen
2014-10-09 16:34                             ` tednolan
2014-10-10 10:34                               ` Corinna Vinschen
2014-10-10 11:24                                 ` Jan Nijtmans
2014-10-10 11:32                                   ` Arjen Markus
2014-10-10 12:10                                     ` tednolan
2014-10-10 12:13                                       ` Arjen Markus
2014-10-10 15:39                                         ` Corinna Vinschen
2014-10-14 19:30                                           ` Corinna Vinschen
2014-10-16 21:51                                             ` Christian Franke
2014-10-17  9:10                                               ` Corinna Vinschen [this message]
2014-10-17 14:51                                                 ` Corinna Vinschen
2014-10-17 17:56                                                   ` Christian Franke
2014-10-17 18:20                                                     ` Corinna Vinschen
2014-10-17 20:36                                                       ` Csaba Raduly
2014-09-12 22:50     ` Eric Blake
2014-09-13  5:24       ` David Boyce
2014-09-14  9:40   ` Csaba Raduly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141017091025.GA10087@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).