- err = NULL;
-
- if (!strstr(fname,".so"))
- {
- err = "This doesn't look like a module file to me...";
- return;
- }
-#ifdef STATIC_LINK
- this->staticname[0] = '\0';
- ServerInstance->Log(DEBUG,"Loading core-compiled module '%s'",fname);
- for (int j = 0; modsyms[j].name; j++)
- {
- ServerInstance->Log(DEBUG,"Check %s",modsyms[j].name);
- if (!strcmp(modsyms[j].name,fname))
- {
- ServerInstance->Log(DEBUG,"Found %s",fname);
- strlcpy(this->staticname,fname,1020);
- err = 0;
- return;
- }
- }
- err = "Module is not statically compiled into the ircd";
-#else
- h = dlopen(fname, RTLD_NOW|RTLD_LOCAL);
- if (!h)
+ static size_t extlen = strlen(DLL_EXTENSION);
+ if (name.length() <= extlen || name.compare(name.length() - extlen, name.length(), DLL_EXTENSION))