-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make dlopen more conservative about opening files the user didn't request #18061
Conversation
#ifdef _OS_WINDOWS_ | ||
else if (modname[1] == ':') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, I noticed that this line was both incorrect and a potential buffer overrun if modname
is an empty string. My new version checks that modname[0]
is nonzero.
LGTM. |
Got |
yes, that's been a common occurrence. lgtm to squash and merge. |
Yay, Travis passed this time. Let's merge when AppVeyor is green. |
…uest (JuliaLang#18061) * make dlopen more conservative about opening files the user didn't request * update manual * recognize \server\foo and /foo/bar absolute paths on windows, similar to isabspath * simplify isabspath from init.c and use it in dlopen instead of duplicating
I was looking at the
dlopen
implementation in Julia in order to document its behavior of appending thedlext
(.so
,.dll
, or.dylib
) and searchingDL_LOAD_PATH
, and I noticed that its attempts to search for the library path were a bit more aggressive than seemed advisable.This patch, in addition to improving the docs, makes
dlopen
more conservative in the following ways:dlopen("foo.dlext")
no longer looks forfoo.dlext.dlext
(whereas it currently looks for this beforefoo.dlext
). If the user explicitly supplies the.dlext
, it seems unexpected that it would openfoo.dlext.dlext
instead.dlopen("/path/to/foo")
no longer searches/bar/path/to/foo
where/bar
is inDL_LOAD_PATH
Also, as an optimization, I changed it to only call
jl_dlopen_soname
(on Linux and BSD) if the library name is not an absolute path and does not have an extension, since the soname map implemented by that function only works for library names without extensions or paths.