aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-09-01 19:46:36 +0200
committerAndreas Schneider <asn@samba.org>2018-09-20 12:07:17 +0200
commitaaeb4549a7b5605faeb5384e9c56db11ba503e99 (patch)
tree4d2a074ec06f7227a2cf7c66ee22d968c05d3a76
parent926c10099d43a5f1f1304e9b9c97ade76fdee2e9 (diff)
downloadpam_wrapper-master-pam_conv.tar.gz
pam_wrapper-master-pam_conv.tar.xz
pam_wrapper-master-pam_conv.zip
pwrap: Don't do a deep bind if we run with libasanmaster-pam_conv
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
-rw-r--r--src/pam_wrapper.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pam_wrapper.c b/src/pam_wrapper.c
index 230a45d..48d2c2a 100644
--- a/src/pam_wrapper.c
+++ b/src/pam_wrapper.c
@@ -300,7 +300,15 @@ static void *pwrap_load_lib_handle(enum pwrap_lib lib)
void *handle = NULL;
#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) < PATH_MAX) {
+ const char *p = strstr(env, "libasan.so");
+ if (p == NULL) {
+ flags |= RTLD_DEEPBIND;
+ }
+ }
#endif
switch (lib) {