This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 1.7.33-0.1
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Fri, 24 Oct 2014 22:16:22 +0200
- Subject: Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 1.7.33-0.1
- Authentication-results: sourceware.org; auth=none
- References: <announce dot 20141022092323 dot GH32374 at calimero dot vinschen dot de> <A0FD00D9-6DFB-4E3D-9FDE-44BC1CAAEEDC at Denis-Excoffier dot org> <20141024110209 dot GJ20607 at calimero dot vinschen dot de> <25D5C8B8-57B7-449C-95C6-CD9055816B6B at Denis-Excoffier dot org> <20141024193638 dot GO20607 at calimero dot vinschen dot de>
Corinna Vinschen wrote:
[Christian, please chime in]
On Oct 24 20:41, Denis Excoffier wrote:
From Cygwin's POV {/usr}/bin is a system dir. For security reasons it
makes sense that the system DLLs in /bin cannot be overridden, unless
it's an installation issue which should be covered by looking into the
application installation dir first.
Instead of adding the lookup of /usr/bin before the PATH, you could add
it afterwards?
No. You don't expect this kind of flexibility in the Win32 API, do you?
[The *LIBPATH variables from MS OS/2 (1987) never made it to Win API :-]
The way it works is, there's a call SetDllDirectory which replaces the "."
in the DLL search path with the directory given as argument. The search
order is always this:
application dir
dir given in SetDllDirecory (Cygwin's bin)
system dirs
$PATH
Or do you mean that my use is bad practice for security
reasons? That there might be some unexpected DLL somewhere in the PATH?
IIRC, in linux/solaris, LD_LIBRARY_PATH is not honored when you are root,
not otherwise.
Not quite. LD_LIBRARY_PATH is only ignored if the excutable is a
suid/sgid executable. Unfortunately we don't have LD_LIBRARY_PATH at
all when running execve (but we have in dlopen).
Having said that, moving your DLLs into the application dir is really
not an option?
Oh yes, i use it all the time. It is the job of 'make install' to also
install the appropriate DLLs. The point here is for 'make check'.
Yeah.
Sigh.
I don't like the idea either that this simple change breaks existing
scenarios. I'm inclined to revert this change.
Christian, would you mind terribly to re-add the tweak to postfix
to set $PATH?
No problem.
Another possible solution:
Check for e.g. CYGWIN_DLLPATH environment variable before calling
SetDllDirectory().
If unset or empty, call SetDllDirectory("X:\path_to_cygwin\bin");
else if set to ".", do nothing.
else call SetDllDirectory(CYGWIN_DLLPATH);
The above 'make check' should then work again as 'CYGWIN_DLLPATH=. make
check'.
Possible enhancement: If AddDllDirectory() is available (>= Win8),
accept a real search path in CYGWIN_DLLPATH.
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