#! /bin/sh /usr/share/dpatch/dpatch-run ## try_libhpmud.so.0.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Try libhpmud.so.0 after libhpmud.so @DPATCH@ --- a/scan/sane/marvell.c +++ b/scan/sane/marvell.c @@ -60,8 +60,14 @@ int stat=1; /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ - if ((ps->hpmud_handle = load_library("libhpmud.so")) == NULL) - goto bugout; + if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL) + { + if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL) + { + BUG("unable to load restricted library: %s\n", dlerror()); + goto bugout; + } + } /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ if ((ps->math_handle = load_library("libm.so")) == NULL) --- a/scan/sane/soap.c +++ b/scan/sane/soap.c @@ -68,8 +68,14 @@ int stat=1; /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ - if ((ps->hpmud_handle = load_library("libhpmud.so")) == NULL) - goto bugout; + if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL) + { + if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL) + { + BUG("unable to load restricted library: %s\n", dlerror()); + goto bugout; + } + } /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ if ((ps->math_handle = load_library("libm.so")) == NULL) --- a/scan/sane/soapht.c +++ b/scan/sane/soapht.c @@ -62,8 +62,14 @@ int stat=1; /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ - if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) - goto bugout; + if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL) + { + if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL) + { + BUG("unable to load restricted library: %s\n", dlerror()); + goto bugout; + } + } /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ if ((ps->math_handle = load_library("libm.so")) == NULL)