X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fdynamic.cpp;h=d9ace43e08b50d4ee20f0278b137b3aaa7326806;hb=db07867e945deb72ce103f796e20104a27c5f68a;hp=dfc02ac245c444c37e667596d1319e1263e4b919;hpb=6c14fd7ccdecbf596d64e5baa5e4e0c09bfa0f0d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/dynamic.cpp b/src/dynamic.cpp index dfc02ac24..d9ace43e0 100644 --- a/src/dynamic.cpp +++ b/src/dynamic.cpp @@ -17,7 +17,7 @@ using namespace std; #include "inspircd_config.h" -#include "inspircd_io.h" +#include "configreader.h" #include "globals.h" #include "dynamic.h" @@ -37,6 +37,11 @@ extern ServerConfig* Config; DLLManager::DLLManager(char *fname) { + if (!strstr(fname,".so")) + { + err = "This doesn't look like a module file to me..."; + return; + } #ifdef STATIC_LINK this->staticname[0] = '\0'; log(DEBUG,"Loading core-compiled module '%s'",fname); @@ -69,6 +74,11 @@ DLLManager::DLLManager(char *fname) // shared libraries are mmap()ed and not doing this causes // segfaults. FILE* x = fopen(fname,"rb"); + if (!x) + { + err = "Module file not found or cannot access, game over man!"; + return; + } char tmpfile_template[255]; char buffer[65536]; snprintf(tmpfile_template, 255, "%s/inspircd_file.so.%d.XXXXXXXXXX",Config->TempDir,getpid());