]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd_io.cpp
Added support for <options customversion> to customize the second part of VERSION
[user/henk/code/inspircd.git] / src / inspircd_io.cpp
index dd5b146922c11e32278e4787c038aabdd66828d4..64b74a2b94534aafeef4f942ea2c484bf4ef2390 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
@@ -29,6 +29,7 @@ using namespace std;
 #include "inspircd_io.h"
 #include "inspstring.h"
 #include "helperfuncs.h"
+#include "userprocess.h"
 #include "xline.h"
 
 extern ServerConfig *Config;
@@ -42,8 +43,8 @@ ServerConfig::ServerConfig()
        this->ClearStack();
        *ServerName = *Network = *ServerDesc = *AdminName = '\0';
        *AdminEmail = *AdminNick = *diepass = *restartpass = '\0';
-       *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0';
-       *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
+       *CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0';
+       *OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
        log_file = NULL;
        nofork = false;
        unlimitcore = false;
@@ -157,6 +158,8 @@ void ServerConfig::Read(bool bail, userrec* user)
         ConfValue("disabled","commands",0,Config->DisabledCommands,&Config->config_f);
         ConfValue("options","somaxconn",0,MCON,&Config->config_f);
         ConfValue("options","softlimit",0,SLIMT,&Config->config_f);
+       ConfValue("options","operonlystats",0,Config->OperOnlyStats,&Config->config_f);
+       ConfValue("options","customversion",0,Config->CustomVersion,&Config->config_f);
 
         Config->SoftLimit = atoi(SLIMT);
         if ((Config->SoftLimit < 1) || (Config->SoftLimit > MAXCLIENTS))
@@ -373,6 +376,8 @@ void Killed(int status)
 void Rehash(int status)
 {
        WriteOpers("Rehashing config file %s due to SIGHUP",CONFIG_FILE);
+       fclose(Config->log_file);
+       OpenLog(NULL,NULL);
        Config->Read(false,NULL);
 }
 
@@ -677,7 +682,7 @@ bool ServerConfig::LoadConf(const char* filename, std::stringstream *target, std
                                                                }
                                                                snprintf(newconf,10240,"%s/%s",confpath,buf);
                                                        }
-                                                       else snprintf(newconf,10240,"%s",buf);
+                                                       else strlcpy(newconf,buf,10240);
                                                        std::stringstream merge(stringstream::in | stringstream::out);
                                                        // recursively call LoadConf and get the new data, use the same errorstream
                                                        if (LoadConf(newconf, &merge, errorstream))