aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-09-01 19:36:19 +0200
committerAndreas Schneider <asn@samba.org>2018-10-23 15:39:17 +0200
commit326e9f8cd33aeac5d4010910cd32f98b7365bdb7 (patch)
treefb03a10a7d0220f09333c0294430f6cb1369b089 /src
parent370ece1e1142be6ce0f153b12b0d8cda1dbcf100 (diff)
downloadsocket_wrapper-326e9f8cd33aeac5d4010910cd32f98b7365bdb7.tar.gz
socket_wrapper-326e9f8cd33aeac5d4010910cd32f98b7365bdb7.tar.xz
socket_wrapper-326e9f8cd33aeac5d4010910cd32f98b7365bdb7.zip
swrap: Don't do a deep bind if we run with libasan
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/socket_wrapper.c10
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) {