* | 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>
#include "inspircd_io.h"
#include "inspstring.h"
#include "helperfuncs.h"
+#include "userprocess.h"
#include "xline.h"
extern ServerConfig *Config;
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;
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))
Classes.clear();
for (int i = 0; i < ConfValueEnum("connect",&Config->config_f); i++)
{
- strcpy(Value,"");
+ *Value = 0;
ConfValue("connect","allow",i,Value,&Config->config_f);
ConfValue("connect","timeout",i,timeout,&Config->config_f);
ConfValue("connect","flood",i,flood,&Config->config_f);
ConfValue("connect","recvq",i,rqmax,&Config->config_f);
if (*Value)
{
- strlcpy(c.host,Value,MAXBUF);
+ c.host = Value;
c.type = CC_ALLOW;
strlcpy(Value,"",MAXBUF);
ConfValue("connect","password",i,Value,&Config->config_f);
- strlcpy(c.pass,Value,MAXBUF);
+ c.pass = Value;
c.registration_timeout = 90; // default is 2 minutes
c.pingtime = 120;
c.flood = atoi(flood);
else
{
ConfValue("connect","deny",i,Value,&Config->config_f);
- strlcpy(c.host,Value,MAXBUF);
+ c.host = Value;
c.type = CC_DENY;
Classes.push_back(c);
- log(DEBUG,"Read connect class type DENY, host=%s",c.host);
+ log(DEBUG,"Read connect class type DENY, host=%s",c.host.c_str());
}
}
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);
}
}
}
-
-int DaemonSeed (void)
+void SetSignals()
{
- int childpid;
signal (SIGALRM, SIG_IGN);
signal (SIGHUP, Rehash);
signal (SIGPIPE, SIG_IGN);
signal (SIGTERM, Exit);
signal (SIGSEGV, Error);
+}
+
+
+int DaemonSeed (void)
+{
+ int childpid;
if ((childpid = fork ()) < 0)
return (ERROR);
else if (childpid > 0)
}
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))
if (!key)
{
/* value not found in tag */
- strcpy(result,"");
+ *result = 0;
return 0;
}
else
if (!*key)
{
/* missing quote */
- strcpy(result,"");
+ *result = 0;
return 0;
}
key++;
}
}
}
- strcpy(result,""); // value or its tag not found at all
+ *result = 0; // value or its tag not found at all
return 0;
}