[ANNOUNCEMENT] TEST RELEASE: Cygwin 1.7.33-0.1

Corinna Vinschen corinna-cygwin@cygwin.com
Sat Oct 25 18:15:00 GMT 2014


On Oct 25 19:29, Denis Excoffier wrote:
> On 2014-10-25 16:49, Corinna Vinschen wrote:
> > Apart from SetDllDirectory and AddDllDirectory, what about this very
> > simple solution in Cygwin:
> > 
> > - Don't call SetDllDirectory at all, thus "." is kept in the search
> >  path.
> > 
> > - In execve, when creating the Windows environment for the child process,
> >  check if $PATH is empty.  If so, set $PATH to /bin for the child.
> >  Or, check if /bin is in $PATH, if not, add it.
>
> Then you may add it at the beginning. People that would want it at the
> end (or elsewhere) can insert it explicitly.

Appending it to PATH doesn't change the search order, prepending does.
Also, appending is the faster technique, especially in this context in
the code.

> Also make sure to consider /usr/bin and /bin as being equivalent here.

This functionality would test the Windows path, not the POSIX path.

> However, modifying PATH behind the scenes may be considered as an
> unexpected intrusion by the user (PATH is for user consumption isn't
> it?). Aren't there any legitimate scenarios where the user would omit
> /usr/bin from the PATH?

No, not really.

> Is it possible to SetDllDirectory("/usr/bin") only if /usr/bin is
> _not_ in PATH?  This would be less intrusive.

This would potentially break your scenario again.  The /bin dir would be
search before your PATH settings again.  Yes, you always have /bin in
PATH, but I'm thinking of the general case.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141025/49c8b0d0/attachment.sig>


More information about the Cygwin mailing list