diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/socket_wrapper.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 3f027dc..0f19b95 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -558,7 +558,15 @@ static void *swrap_load_lib_handle(enum swrap_lib lib) int i; #ifdef RTLD_DEEPBIND - flags |= RTLD_DEEPBIND; + const char *env = getenv("LD_PRELOAD"); + + /* Don't do a deepbind if we run with libasan */ + if (env != NULL && strlen(env) < 1024) { + const char *p = strstr(env, "libasan.so"); + if (p == NULL) { + flags |= RTLD_DEEPBIND; + } + } #endif switch (lib) { |
