diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2011-10-25 12:28:51 +0200 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2011-10-25 12:28:51 +0200 |
commit | e4aa966cf25e83cd0c72f34f7855a995ff93944d (patch) | |
tree | 64e05ea7e75064bb994ba3b4df28a2ca29375587 /ldso/libdl/libdl.c | |
parent | 6d71db548d1186a9215bebafaee8e38b6cb7d513 (diff) |
ldso: let people disable to lookup into LD_LIBRARY_PATH
On hardened system it could be useful to disable the use
of LD_LIBRARY_PATH.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'ldso/libdl/libdl.c')
-rw-r--r-- | ldso/libdl/libdl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index 5b519e6d0..c164ffbee 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -100,7 +100,9 @@ int _dl_debug_file = 2; const char *_dl_progname = ""; /* Program name */ void *(*_dl_malloc_function)(size_t); void (*_dl_free_function) (void *p); +#ifdef __LDSO_LD_LIBRARY_PATH__ char *_dl_library_path = NULL; /* Where we look for libraries */ +#endif int _dl_errno = 0; /* We can't use the real errno in ldso */ size_t _dl_pagesize = PAGE_SIZE; /* Store the page size for use later */ /* This global variable is also to communicate with debuggers such as gdb. */ @@ -368,7 +370,7 @@ void *dlopen(const char *libname, int flag) if (getenv("LD_BIND_NOW")) now_flag = RTLD_NOW; -#ifndef SHARED +#if !defined SHARED && defined __LDSO_LIBRARY_PATH__ /* When statically linked, the _dl_library_path is not yet initialized */ _dl_library_path = getenv("LD_LIBRARY_PATH"); #endif |