diff options
| author | Matthew N. Dodd <mdodd@FreeBSD.org> | 2003-05-31 14:45:11 +0000 |
|---|---|---|
| committer | Matthew N. Dodd <mdodd@FreeBSD.org> | 2003-05-31 14:45:11 +0000 |
| commit | 4df60d1cacdeb2cac619f84e0033643c19962c0c (patch) | |
| tree | 25facbede77df18eef5265ea0f3f0a7dfe942321 /libexec | |
| parent | 15c3fb05e511e749a54e9aa8470e086b39129130 (diff) | |
Notes
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/rtld-elf/rtld.1 | 3 | ||||
| -rw-r--r-- | libexec/rtld-elf/rtld.c | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 3daad6be998b6..5ba43e02a8217 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -83,6 +83,9 @@ recognizes a number of environment variables that can be used to modify its behaviour as follows: .Pp .Bl -tag -width ".Ev LD_LIBRARY_PATH" +.It Ev LD_LIBMAP_DISABLE +If set disables the use of +.Xr libmap.conf 5 . .It Ev LD_LIBRARY_PATH A colon separated list of directories, overriding the default search path for shared libraries. diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 01a1a338814b7..9bbd5d4d92b49 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -134,6 +134,7 @@ void r_debug_state(struct r_debug*, struct link_map*); */ static char *error_message; /* Message for dlerror(), or NULL */ struct r_debug r_debug; /* for GDB; */ +static bool libmap_disable; /* Disable libmap */ static bool trust; /* False for setuid and setgid programs */ static char *ld_bind_now; /* Environment variable for immediate binding */ static char *ld_debug; /* Environment variable for debugging */ @@ -263,6 +264,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) trust = geteuid() == getuid() && getegid() == getgid(); + libmap_disable = getenv("LD_LIBMAP_DISABLE") != NULL; + ld_bind_now = getenv("LD_BIND_NOW"); if (trust) { ld_debug = getenv("LD_DEBUG"); @@ -339,7 +342,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) sym_zero.st_shndx = SHN_UNDEF; #ifdef WITH_LIBMAP - lm_init(); + if (!libmap_disable) + lm_init(); #endif dbg("loading LD_PRELOAD libraries"); @@ -795,7 +799,7 @@ find_library(const char *xname, const Obj_Entry *refobj) } #ifdef WITH_LIBMAP - if ((name = lm_find(refobj->path, xname)) == NULL) + if (libmap_disable || (name = lm_find(refobj->path, xname)) == NULL) #endif name = (char *)xname; @@ -1434,7 +1438,8 @@ rtld_exit(void) objlist_call_fini(&list_fini); /* No need to remove the items from the list, since we are exiting. */ #ifdef WITH_LIBMAP - lm_fini(); + if (!libmap_disable) + lm_fini(); #endif } |
