--- src/plugins/InstrumentEditorFactory.cpp.orig 2007-12-29 18:38:18.000000000 +0100 +++ src/plugins/InstrumentEditorFactory.cpp 2007-12-29 18:36:28.000000000 +0100 @@ -28,6 +28,9 @@ #include #include #include +#include +#include +#include #endif #include @@ -185,16 +188,20 @@ return; } for (dirent* pEntry = readdir(hDir); pEntry; pEntry = readdir(hDir)) { - // skip entries that are not regular files - if (pEntry->d_type != DT_REG) continue; String sPath = pEntry->d_name; + // make it a full qualified path + sPath = CONFIG_PLUGIN_DIR + ("/" + sPath); + // skip entries that are not regular files + struct stat sPath_stat; + if (lstat(sPath.c_str(), &sPath_stat) != 0 || + (sPath_stat.st_mode & S_IFMT) != S_IFREG) + continue; + // skip files that are not .so files - if ( + if (sPath.length() < 3 || sPath.substr(sPath.length() - 3) != ".so" && sPath.find(".so.") == String::npos ) continue; - // make it a full qualified path - sPath = CONFIG_PLUGIN_DIR + ("/" + sPath); // load the DLL (the plugins should register themselfes automatically) void* pDLL = dlopen(sPath.c_str(), RTLD_NOW); if (pDLL) LoadedDLLs.push_back(pDLL);