Use RTLD_NOW instead of RTLD_LAZY when dlopen()ing modules

Now a module with unresolved symbols will fail to load instead of
potentially getting ZNC killed when an undefined symbol was used.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1332 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-01-15 18:56:36 +00:00
parent 2efea2157a
commit c44d3f1751

View File

@@ -723,7 +723,7 @@ bool CModules::LoadModule(const CString& sModule, const CString& sArgs, CUser* p
return true;
}
unsigned int uDLFlags = RTLD_LAZY;
unsigned int uDLFlags = RTLD_NOW;
uDLFlags |= (pUser) ? RTLD_LOCAL : RTLD_GLOBAL;
void* p = dlopen((sModPath).c_str(), uDLFlags);