Add ./configure --enable-run-from-source

Unless this flag is used, znc will no longer look for modules in ./modules/
because this might be exploitable by lucky attackers.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1927 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-04-23 16:27:21 +00:00
parent 16ad0950ea
commit fe6a930a01
3 changed files with 27 additions and 10 deletions

View File

@@ -908,6 +908,7 @@ bool CModules::FindModPath(const CString& sModule, CString& sModPath,
CModules::ModDirList CModules::GetModDirs() {
ModDirList ret;
#ifdef RUN_FROM_SOURCE
// ./modules
CString sDir = CZNC::Get().GetCurPath() + "/modules/";
ret.push(std::make_pair(sDir, sDir));
@@ -915,6 +916,7 @@ CModules::ModDirList CModules::GetModDirs() {
// ./modules/extra
sDir = CZNC::Get().GetCurPath() + "/modules/extra/";
ret.push(std::make_pair(sDir, sDir));
#endif
// ~/.znc/modules
sDir = CZNC::Get().GetModPath() + "/";