diff --git a/capsule/capsule-dlmopen.c b/capsule/capsule-dlmopen.c index 8ce21457075e7b4d6169e732a4892b17588ef010..25f95b3540a51fbe87e27259bb01fe5ecf9a4f08 100644 --- a/capsule/capsule-dlmopen.c +++ b/capsule/capsule-dlmopen.c @@ -508,6 +508,7 @@ dso_find (const char *name, ldlibs_t *ldlibs, int i) { int found = 0; const char *ldpath = NULL; + int absolute = (name && (name[0] == '/')); // absolute path, or relative to CWD: if( strchr( name, '/' ) ) @@ -538,10 +539,14 @@ dso_find (const char *name, ldlibs_t *ldlibs, int i) target = name; } + ldlib_debug( ldlibs, "resolving path %s", target ); if( realpath( target, ldlibs->needed[i].path ) ) return ldlib_open( ldlibs, name, i ); } + if( absolute ) + return 0; + if( (ldpath = getenv( "LD_LIBRARY_PATH" )) ) if( (found = search_ldpath( name, ldpath, ldlibs, i )) ) return found;