*CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0';
*OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
log_file = NULL;
- forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = false;
+ NoUserDns = forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = false;
writelog = AllowHalfop = true;
dns_timeout = DieDelay = 5;
MaxTargets = 20;
return true;
}
+bool InitializeDisabledCommands(const char* data, InspIRCd* ServerInstance)
+{
+ std::stringstream dcmds(data);
+ std::string thiscmd;
+
+ /* Enable everything first */
+ for (nspace::hash_map<std::string,command_t*>::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++)
+ x->second->Disable(false);
+
+ /* Now disable all the ones which the user wants disabled */
+ while (dcmds >> thiscmd)
+ {
+ nspace::hash_map<std::string,command_t*>::iterator cm = ServerInstance->Parser->cmdlist.find(thiscmd);
+ if (cm != ServerInstance->Parser->cmdlist.end())
+ {
+ log(DEBUG,"Disabling command '%s'",cm->second->command.c_str());
+ cm->second->Disable(true);
+ }
+ }
+ return true;
+}
+
bool ValidateDnsServer(const char* tag, const char* value, void* data)
{
char* x = (char*)data;
{"options", "hidewhois", &this->HideWhoisServer, DT_CHARPTR, NoValidation},
{"options", "operspywhois", &this->OperSpyWhois, DT_BOOLEAN, NoValidation},
{"options", "tempdir", &this->TempDir, DT_CHARPTR, ValidateTempDir},
+ {"options", "nouserdns", &this->NoUserDns, DT_BOOLEAN, NoValidation},
{"pid", "file", &this->PID, DT_CHARPTR, NoValidation},
{NULL}
};
delete[] data[n];
// write once here, to try it out and make sure its ok
- WritePID(Config->PID);
+ ServerInstance->WritePID(Config->PID);
log(DEFAULT,"Done reading configuration file, InspIRCd is now starting.");
if(in_comment)
continue;
-
+
+ /* XXX: Added by Brain, May 1st 2006 - Escaping of characters.
+ * Note that this WILL NOT usually allow insertion of newlines,
+ * because a newline is two characters long. Use it primarily to
+ * insert the " symbol.
+ *
+ * Note that this also involves a further check when parsing the line,
+ * which can be found below.
+ */
+ if ((ch == '\\') && (in_quote) && (in_tag))
+ {
+ line += ch;
+ log(DEBUG,"Escape sequence in config line.");
+ char real_character;
+ if (conf.get(real_character))
+ {
+ log(DEBUG,"Escaping %c", real_character);
+ line += real_character;
+ continue;
+ }
+ else
+ {
+ errorstream << "End of file after a \\, what did you want to escape?: " << filename << ":" << linenumber << std::endl;
+ return false;
+ }
+ }
+
line += ch;
if(ch == '<')
else
{
/* We have the tag name */
- if(!got_key)
+ if (!got_key)
{
/* We're still reading the key name */
- if(*c != '=')
+ if (*c != '=')
{
- if(*c != ' ')
+ if (*c != ' ')
{
current_key += *c;
}
else
{
/* We have the key name, now we're looking for quotes and the value */
- if(*c == '"')
+
+ /* Correctly handle escaped characters here.
+ * See the XXX'ed section above.
+ */
+ if ((*c == '\\') && (in_quote))
+ {
+ c++;
+ current_value += *c;
+ continue;
+ }
+ if (*c == '"')
{
- if(!in_quote)
+ if (!in_quote)
{
/* We're not already in a quote. */
in_quote = true;