X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=dlwrap.c;h=69ffbd16fc6dde0dace5289aba1986f900ca5725;hb=02c39fbdaa29d62a8e7b8d223f62ccd08d4782ee;hp=9f623da549b3e74c2db2a261caddbe95e9e00081;hpb=54157251d30d586e8f97fb594f22bf18e9ac4bbe;p=fips diff --git a/dlwrap.c b/dlwrap.c index 9f623da..69ffbd1 100644 --- a/dlwrap.c +++ b/dlwrap.c @@ -41,10 +41,18 @@ void * dlopen (const char *filename, int flag) { Dl_info info; + void *ret; + + /* Before deciding whether to redirect this dlopen to our own + * library, we call the real dlopen. This assures that any + * expected side-effects from loading the intended library are + * resolved. Below, we may still return a handle pointing to + * our own library, and not what is opened here. */ + ret = dlwrap_real_dlopen (filename, flag); /* Not libGL, so just return real dlopen */ if (STRNCMP_LITERAL (filename, "libGL.so")) - return dlwrap_real_dlopen (filename, flag); + return ret; /* Otherwise, for all libGL lookups we redirectl dlopens to * our own library. If we've resolved libfips_handle before,