uwrap: Attempt to dlopen libc.so.*.1 as a fallback.
authorMatt Turner <mattst88@gmail.com>
Tue, 5 Apr 2016 20:41:13 +0000 (13:41 -0700)
committerAndreas Schneider <asn@samba.org>
Thu, 2 Jun 2016 13:58:48 +0000 (15:58 +0200)
glibc on Alpha and IA64 is libc.so.6.1.

Without this, uwrap.libc.handle is set to RTLD_NEXT, leading to a
segmentation fault in the unit tests when dlclose() is called.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11821

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
src/uid_wrapper.c

index 743d590b68767675345e74c501c7a86fa55695f3..34889e0c3f955ad04bda3859b734a86763dee529 100644 (file)
@@ -407,6 +407,13 @@ static void *uwrap_load_lib_handle(enum uwrap_lib lib)
                                if (handle != NULL) {
                                        break;
                                }
+
+                               /* glibc on Alpha and IA64 is libc.so.6.1 */
+                               snprintf(soname, sizeof(soname), "libc.so.%d.1", i);
+                               handle = dlopen(soname, flags);
+                               if (handle != NULL) {
+                                       break;
+                               }
                        }
 
                        uwrap.libc.handle = handle;