Skip to content
Snippets Groups Projects
Commit 0ea30842 authored by Vivek Das Mohapatra's avatar Vivek Das Mohapatra
Browse files

Don't search for absolute paths in LD_LIBRARY_PATH style path-lists

If a path handed to us was absolute all we need do is trasnpose it
to the capsule prefix and look for it there - it makes no sense to
do the usual LD_LIBRARY_PATH; /lib/:/usr/lib; ld.so.cache searches
for an absolute path.
parent ce84258a
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -508,6 +508,7 @@ dso_find (const char *name, ldlibs_t *ldlibs, int i) ...@@ -508,6 +508,7 @@ dso_find (const char *name, ldlibs_t *ldlibs, int i)
{ {
int found = 0; int found = 0;
const char *ldpath = NULL; const char *ldpath = NULL;
int absolute = (name && (name[0] == '/'));
// absolute path, or relative to CWD: // absolute path, or relative to CWD:
if( strchr( name, '/' ) ) if( strchr( name, '/' ) )
...@@ -538,10 +539,14 @@ dso_find (const char *name, ldlibs_t *ldlibs, int i) ...@@ -538,10 +539,14 @@ dso_find (const char *name, ldlibs_t *ldlibs, int i)
target = name; target = name;
} }
ldlib_debug( ldlibs, "resolving path %s", target );
if( realpath( target, ldlibs->needed[i].path ) ) if( realpath( target, ldlibs->needed[i].path ) )
return ldlib_open( ldlibs, name, i ); return ldlib_open( ldlibs, name, i );
} }
if( absolute )
return 0;
if( (ldpath = getenv( "LD_LIBRARY_PATH" )) ) if( (ldpath = getenv( "LD_LIBRARY_PATH" )) )
if( (found = search_ldpath( name, ldpath, ldlibs, i )) ) if( (found = search_ldpath( name, ldpath, ldlibs, i )) )
return found; return found;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment