From 9f62336e3351960105018810918ddc5a7d9ed1a9 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 26 Apr 2024 08:34:56 +0200 Subject: [PATCH] Don't use (DY)LD_LIBRARY_PATH as plugin search paths (#4245) Only use the OIIO_LIBRARY_PATH environment variable by default. Searching through such system paths has some risk loading plugins installed for another purpose or that may be incompatible. If the previous behavior is desired, applications can add these environment variables to the plugin search path manually. Signed-off-by: Brecht Van Lommel --- src/libOpenImageIO/imageioplugin.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/libOpenImageIO/imageioplugin.cpp b/src/libOpenImageIO/imageioplugin.cpp index 9ad45042e3..d2a0210fff 100644 --- a/src/libOpenImageIO/imageioplugin.cpp +++ b/src/libOpenImageIO/imageioplugin.cpp @@ -469,12 +469,6 @@ pvt::catalog_all_plugins(std::string searchpath) std::unique_lock lock(imageio_mutex); append_if_env_exists(searchpath, "OIIO_LIBRARY_PATH", true); -#ifdef __APPLE__ - append_if_env_exists(searchpath, "DYLD_LIBRARY_PATH"); -#endif -#if defined(__linux__) || defined(__FreeBSD__) - append_if_env_exists(searchpath, "LD_LIBRARY_PATH"); -#endif size_t patlen = pattern.length(); std::vector dirs;