summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-06 13:41:24 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-06 13:41:24 +0000
commit6c14fd7ccdecbf596d64e5baa5e4e0c09bfa0f0d (patch)
treef0122b65721eb6881e78ccc556d13fb64e9ef40a /src
parent6d94d84683bd0e916e5ce0a3c7fedbc524d653b0 (diff)
Added support for changing tempdir via <options:tempdir>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3107 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/dynamic.cpp2
-rw-r--r--src/inspircd_io.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/dynamic.cpp b/src/dynamic.cpp
index 1dfb823c6..dfc02ac24 100644
--- a/src/dynamic.cpp
+++ b/src/dynamic.cpp
@@ -71,7 +71,7 @@ DLLManager::DLLManager(char *fname)
FILE* x = fopen(fname,"rb");
char tmpfile_template[255];
char buffer[65536];
- snprintf(tmpfile_template, 255, "/tmp/inspircd_file.so.%d.XXXXXXXXXX",getpid());
+ snprintf(tmpfile_template, 255, "%s/inspircd_file.so.%d.XXXXXXXXXX",Config->TempDir,getpid());
int fd = mkstemp(tmpfile_template);
while (!feof(x))
{
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 7630eddce..02f3a1e2d 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -44,7 +44,7 @@ extern std::vector<ircd_module*> factory;
ServerConfig::ServerConfig()
{
this->ClearStack();
- *ServerName = *Network = *ServerDesc = *AdminName = '\0';
+ *TempDir = *ServerName = *Network = *ServerDesc = *AdminName = '\0';
*HideWhoisServer = *AdminEmail = *AdminNick = *diepass = *restartpass = '\0';
*CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0';
*OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
@@ -228,7 +228,10 @@ void ServerConfig::Read(bool bail, userrec* user)
ConfValue("options","maxtargets",0,MT,&Config->config_f);
ConfValue("options","hidesplits",0,HS,&Config->config_f);
ConfValue("options","hidewhois",0,Config->HideWhoisServer,&Config->config_f);
+ ConfValue("options","tempdir",0,Config->TempDir,&Config->config_f);
+ if (!*Config->TempDir)
+ strlcpy(Config->TempDir,"/tmp");
Config->HideSplits = ((*HS == 'y') || (*HS == 'Y') || (*HS == '1') || (*HS == 't') || (*HS == 'T'));
Config->SoftLimit = atoi(SLIMT);
if (*MT)