From dd269a0bf49a6b680139689a319c4d329d665d0e Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 27 Jul 2017 08:33:31 +0000 Subject: [PATCH] Allow to specify targets by absolute paths in libmap.conf. Submitted by: Tatu Kilappa PR: 221032 MFC after: 2 weeks --- libexec/rtld-elf/rtld.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index ea3cacb2a73d..596f268c79c6 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1590,20 +1590,21 @@ find_library(const char *xname, const Obj_Entry *refobj, int *fdp) bool nodeflib, objgiven; objgiven = refobj != NULL; - if (strchr(xname, '/') != NULL) { /* Hard coded pathname */ - if (xname[0] != '/' && !trust) { - _rtld_error("Absolute pathname required for shared object \"%s\"", - xname); - return NULL; - } - return (origin_subst(__DECONST(Obj_Entry *, refobj), - __DECONST(char *, xname))); - } if (libmap_disable || !objgiven || - (name = lm_find(refobj->path, xname)) == NULL) + (name = lm_find(refobj->path, xname)) == NULL) name = (char *)xname; + if (strchr(name, '/') != NULL) { /* Hard coded pathname */ + if (name[0] != '/' && !trust) { + _rtld_error("Absolute pathname required for shared object \"%s\"", + name); + return (NULL); + } + return (origin_subst(__DECONST(Obj_Entry *, refobj), + __DECONST(char *, name))); + } + dbg(" Searching for \"%s\"", name); /*