Anope IRC Services  Version 1.8
config.c
Go to the documentation of this file.
1 /* Configuration file handling.
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  *
11  *
12  */
13 
14 #include "services.h"
15 
16 /*************************************************************************/
17 
18 /* Configurable variables: */
19 
20 char *IRCDModule;
21 char *EncModule;
25 
29 
33 
34 char *LocalHost;
36 
37 char *ServerName;
38 char *ServerDesc;
41 static char *temp_userhost;
42 
44 char *LogChannel;
46 int NickLen;
47 
48 char *s_NickServ;
49 char *s_ChanServ;
50 char *s_MemoServ;
51 char *s_BotServ;
52 char *s_HelpServ;
53 char *s_OperServ;
55 char *s_DevNull;
64 
65 char *HostDBName; /* Name of HostServ DB File */
66 char *s_HostServ; /* HostServ Name */
67 char *desc_HostServ; /* HostServ Description */
68 
87 
90 char *NickDBName;
92 char *ChanDBName;
93 char *BotDBName;
94 char *OperDBName;
96 char *NewsDBName;
97 
98 char *HostSetter;
99 char **HostSetters;
100 int HostNumber = 0; /* needs to be set to 0 */
101 
123 
126 char *SendFrom;
131 
132 static int NSDefNone;
158 static char *temp_nsuserhost;
169 
195 
200 
214 
223 int RootNumber = 0;
225 int LogBot;
259 
269 
271 
272 char *Modules;
278 
285 
289 
293 
297 
301 
305 
309 
310 
311 char *MysqlHost;
312 char *MysqlUser;
313 char *MysqlPass;
314 char *MysqlName;
317 char *MysqlSock;
318 int MysqlRetries = 0;
320 int UseRDB = 0;
321 
328 int DefCon[6];
338 
339 long unsigned int UserKey1;
340 long unsigned int UserKey2;
341 long unsigned int UserKey3;
342 
343 char *Numeric;
344 
346 
348 char **Ulines;
349 int NumUlines = 0;
350 
351 int UseTS6;
352 
353 
354 /*************************************************************************/
355 
356 /* Deprecated directive (dep_) and value checking (chk_) functions: */
357 
358 /* Hey, there are no left! -GD */
359 
360 /*************************************************************************/
361 
363  {"AkillOnAdd", {{PARAM_SET, PARAM_RELOAD, &AkillOnAdd}}},
364  {"AutokillDB", {{PARAM_STRING, PARAM_RELOAD, &AutokillDBName}}},
365  {"AutokillExpiry", {{PARAM_TIME, PARAM_RELOAD, &AutokillExpiry}}},
366  {"ChankillExpiry", {{PARAM_TIME, PARAM_RELOAD, &ChankillExpiry}}},
367  {"BadPassLimit", {{PARAM_POSINT, PARAM_RELOAD, &BadPassLimit}}},
368  {"BadPassTimeout", {{PARAM_TIME, PARAM_RELOAD, &BadPassTimeout}}},
369  {"BotCoreModules", {{PARAM_STRING, PARAM_RELOAD, &BotCoreModules}}},
370  {"BotServDB", {{PARAM_STRING, PARAM_RELOAD, &BotDBName}}},
371  {"BotServName", {{PARAM_STRING, 0, &s_BotServ},
372  {PARAM_STRING, 0, &desc_BotServ}}},
373  {"BotServAlias", {{PARAM_STRING, 0, &s_BotServAlias},
375  {"BSBadWordsMax", {{PARAM_POSINT, PARAM_RELOAD, &BSBadWordsMax}}},
376  {"BSDefDontKickOps", {{PARAM_SET, PARAM_RELOAD, &BSDefDontKickOps}}},
377  {"BSDefDontKickVoices",
379  {"BSDefGreet", {{PARAM_SET, PARAM_RELOAD, &BSDefGreet}}},
380  {"BSDefFantasy", {{PARAM_SET, PARAM_RELOAD, &BSDefFantasy}}},
381  {"BSDefSymbiosis", {{PARAM_SET, PARAM_RELOAD, &BSDefSymbiosis}}},
382  {"BSCaseSensitive", {{PARAM_SET, PARAM_RELOAD, &BSCaseSensitive}}},
383  {"BSFantasyCharacter",
385  {"BSGentleBWReason", {{PARAM_SET, PARAM_RELOAD, &BSGentleBWReason}}},
386  {"BSKeepData", {{PARAM_TIME, PARAM_RELOAD, &BSKeepData}}},
387  {"BSMinUsers", {{PARAM_POSINT, PARAM_RELOAD, &BSMinUsers}}},
388  {"BSSmartJoin", {{PARAM_SET, PARAM_RELOAD, &BSSmartJoin}}},
389  {"HostServDB", {{PARAM_STRING, PARAM_RELOAD, &HostDBName}}},
390  {"HostServName", {{PARAM_STRING, 0, &s_HostServ},
391  {PARAM_STRING, 0, &desc_HostServ}}},
392  {"ChanCoreModules", {{PARAM_STRING, PARAM_RELOAD, &ChanCoreModules}}},
393  {"ChanServDB", {{PARAM_STRING, PARAM_RELOAD, &ChanDBName}}},
394  {"ChanServName", {{PARAM_STRING, 0, &s_ChanServ},
395  {PARAM_STRING, 0, &desc_ChanServ}}},
396  {"ChanServAlias", {{PARAM_STRING, 0, &s_ChanServAlias},
398  {"CSAccessMax", {{PARAM_POSINT, PARAM_RELOAD, &CSAccessMax}}},
399  {"CSAutokickMax", {{PARAM_POSINT, PARAM_RELOAD, &CSAutokickMax}}},
400  {"CSAutokickReason",
402  {"CSDefBantype", {{PARAM_INT, PARAM_RELOAD, &CSDefBantype}}},
403  {"CSDefNone", {{PARAM_SET, PARAM_RELOAD, &CSDefNone}}},
404  {"CSDefKeepTopic", {{PARAM_SET, PARAM_RELOAD, &CSDefKeepTopic}}},
405  {"CSDefOpNotice", {{PARAM_SET, PARAM_RELOAD, &CSDefOpNotice}}},
406  {"CSDefPeace", {{PARAM_SET, PARAM_RELOAD, &CSDefPeace}}},
407  {"CSDefPrivate", {{PARAM_SET, PARAM_RELOAD, &CSDefPrivate}}},
408  {"CSDefRestricted", {{PARAM_SET, PARAM_RELOAD, &CSDefRestricted}}},
409  {"CSDefSecure", {{PARAM_SET, PARAM_RELOAD, &CSDefSecure}}},
410  {"CSDefSecureOps", {{PARAM_SET, PARAM_RELOAD, &CSDefSecureOps}}},
411  {"CSDefSecureFounder",
413  {"CSDefSignKick", {{PARAM_SET, PARAM_RELOAD, &CSDefSignKick}}},
414  {"CSDefSignKickLevel",
416  {"CSDefTopicLock", {{PARAM_SET, PARAM_RELOAD, &CSDefTopicLock}}},
417  {"CSDefXOP", {{PARAM_SET, PARAM_RELOAD, &CSDefXOP}}},
418  {"CSExpire", {{PARAM_TIME, PARAM_RELOAD, &CSExpire}}},
419  {"CSInhabit", {{PARAM_TIME, PARAM_RELOAD, &CSInhabit}}},
420  {"CSListMax", {{PARAM_POSINT, PARAM_RELOAD, &CSListMax}}},
421  {"CSListOpersOnly", {{PARAM_SET, PARAM_RELOAD, &CSListOpersOnly}}},
422  {"CSMaxReg", {{PARAM_POSINT, 0, &CSMaxReg}}},
423  {"CSRestrictGetPass", {{PARAM_SET, PARAM_RELOAD, &CSRestrictGetPass}}},
424  {"CSOpersOnly", {{PARAM_SET, PARAM_RELOAD, &CSOpersOnly}}},
425  {"DefSessionLimit", {{PARAM_POSINT, 0, &DefSessionLimit}}},
426  {"DevNullName", {{PARAM_STRING, 0, &s_DevNull},
427  {PARAM_STRING, 0, &desc_DevNull}}},
428  {"DevNullAlias", {{PARAM_STRING, 0, &s_DevNullAlias},
430  {"DisableRaw", {{PARAM_SET, PARAM_RELOAD, &DisableRaw}}},
431  {"DontQuoteAddresses",
433  {"ForkForMail", {{PARAM_SET, PARAM_RELOAD, &ForkForMail}}},
434  {"DumpCore", {{PARAM_SET, 0, &DumpCore}}},
435  {"DefConLevel", {{PARAM_INT, PARAM_RELOAD, &DefConLevel}}},
436  {"DefCon1", {{PARAM_INT, PARAM_RELOAD, &DefCon1}}},
437  {"DefCon2", {{PARAM_INT, PARAM_RELOAD, &DefCon2}}},
438  {"DefCon3", {{PARAM_INT, PARAM_RELOAD, &DefCon3}}},
439  {"DefCon4", {{PARAM_INT, PARAM_RELOAD, &DefCon4}}},
440  {"DefConSessionLimit",
442  {"DefConAkillExpire", {{PARAM_STRING, PARAM_RELOAD, &DefConAKILL}}},
443  {"DefConChanModes", {{PARAM_STRING, PARAM_RELOAD, &DefConChanModes}}},
444  {"DefConTimeOut", {{PARAM_STRING, PARAM_RELOAD, &DefConTimeOut}}},
445  {"DefConAkillReason",
447  {"DefConOffMessage",
449  {"EncModule", {{PARAM_STRING, 0, &EncModule}}},
450  {"ExceptionDB", {{PARAM_STRING, PARAM_RELOAD, &ExceptionDBName}}},
451  {"ExceptionExpiry", {{PARAM_TIME, PARAM_RELOAD, &ExceptionExpiry}}},
452  {"ExpireTimeout", {{PARAM_TIME, PARAM_RELOAD, &ExpireTimeout}}},
453  {"ForceForbidReason", {{PARAM_SET, PARAM_RELOAD, &ForceForbidReason}}},
454  {"GlobalName", {{PARAM_STRING, 0, &s_GlobalNoticer},
456  {"GlobalAlias", {{PARAM_STRING, 0, &s_GlobalNoticerAlias},
458  {"HelpCoreModules", {{PARAM_STRING, PARAM_RELOAD, &HelpCoreModules}}},
459  {"HelpChannel", {{PARAM_STRING, PARAM_RELOAD, &HelpChannel}}},
460  {"HostCoreModules", {{PARAM_STRING, PARAM_RELOAD, &HostCoreModules}}},
461  {"HostServAlias", {{PARAM_STRING, 0, &s_HostServAlias},
463  {"HostSetters", {{PARAM_STRING, PARAM_RELOAD, &HostSetter}}},
464  {"IRCDModule", {{PARAM_STRING, 0, &IRCDModule}}},
465  {"LogChannel", {{PARAM_STRING, PARAM_RELOAD, &LogChannel}}},
466  {"LogBot", {{PARAM_SET, PARAM_RELOAD, &LogBot}}},
467  {"HelpServName", {{PARAM_STRING, 0, &s_HelpServ},
468  {PARAM_STRING, 0, &desc_HelpServ}}},
469  {"HelpServAlias", {{PARAM_STRING, 0, &s_HelpServAlias},
471  {"KeepBackups", {{PARAM_INT, PARAM_RELOAD, &KeepBackups}}},
472  {"KeepLogs", {{PARAM_INT, PARAM_RELOAD, &KeepLogs}}},
473  {"KillonSGline", {{PARAM_SET, PARAM_RELOAD, &KillonSGline}}},
474  {"KillonSQline", {{PARAM_SET, PARAM_RELOAD, &KillonSQline}}},
475  {"AddAkiller", {{PARAM_SET, PARAM_RELOAD, &AddAkiller}}},
476  {"LimitSessions", {{PARAM_SET, PARAM_FULLONLY, &LimitSessions}}},
477  {"LocalAddress", {{PARAM_STRING, 0, &LocalHost},
479  {"LogUsers", {{PARAM_SET, PARAM_RELOAD, &LogUsers}}},
480  {"SuperAdmin", {{PARAM_SET, PARAM_RELOAD, &SuperAdmin}}},
481  {"LogMaxUsers", {{PARAM_SET, PARAM_RELOAD, &LogMaxUsers}}},
482  {"MailDelay", {{PARAM_TIME, PARAM_RELOAD, &MailDelay}}},
483  {"MaxSessionKill", {{PARAM_INT, PARAM_RELOAD, &MaxSessionKill}}},
484  {"MaxSessionLimit", {{PARAM_POSINT, PARAM_RELOAD, &MaxSessionLimit}}},
485  {"MemoCoreModules", {{PARAM_STRING, PARAM_RELOAD, &MemoCoreModules}}},
486  {"MemoServName", {{PARAM_STRING, 0, &s_MemoServ},
487  {PARAM_STRING, 0, &desc_MemoServ}}},
488  {"MemoServAlias", {{PARAM_STRING, 0, &s_MemoServAlias},
490  {"MysqlHost", {{PARAM_STRING, PARAM_RELOAD, &MysqlHost}}},
491  {"MysqlUser", {{PARAM_STRING, PARAM_RELOAD, &MysqlUser}}},
492  {"MysqlPass", {{PARAM_STRING, PARAM_RELOAD, &MysqlPass}}},
493  {"MysqlName", {{PARAM_STRING, PARAM_RELOAD, &MysqlName}}},
494  {"MysqlPort", {{PARAM_PORT, PARAM_RELOAD, &MysqlPort}}},
495  {"MysqlSecure", {{PARAM_STRING, PARAM_RELOAD, &MysqlSecure}}},
496  {"MysqlSock", {{PARAM_STRING, PARAM_RELOAD, &MysqlSock}}},
497  {"MysqlRetries", {{PARAM_POSINT, PARAM_RELOAD, &MysqlRetries}}},
498  {"MysqlRetryGap", {{PARAM_POSINT, PARAM_RELOAD, &MysqlRetryGap}}},
499  {"UseRDB", {{PARAM_SET, PARAM_RELOAD, &UseRDB}}},
500  {"ModuleAutoload", {{PARAM_STRING, PARAM_RELOAD, &Modules}}},
501  {"ModuleDelayedAutoload",
503  {"MOTDFile", {{PARAM_STRING, PARAM_RELOAD, &MOTDFilename}}},
504  {"MSMaxMemos", {{PARAM_POSINT, PARAM_RELOAD, &MSMaxMemos}}},
505  {"MSNotifyAll", {{PARAM_SET, PARAM_RELOAD, &MSNotifyAll}}},
506  {"MSSendDelay", {{PARAM_TIME, PARAM_RELOAD, &MSSendDelay}}},
507  {"MSMemoReceipt", {{PARAM_POSINT, PARAM_RELOAD, &MSMemoReceipt}}},
508  {"NetworkName", {{PARAM_STRING, PARAM_RELOAD, &NetworkName}}},
509  {"NewsCount", {{PARAM_POSINT, PARAM_RELOAD, &NewsCount}}},
510  {"NewsDB", {{PARAM_STRING, PARAM_RELOAD, &NewsDBName}}},
511  {"NickLen", {{PARAM_POSINT, 0, &NickLen}}},
512  {"NickservDB", {{PARAM_STRING, PARAM_RELOAD, &NickDBName}}},
513  {"Numeric", {{PARAM_STRING, PARAM_RELOAD, &Numeric}}},
514  {"PreNickServDB", {{PARAM_STRING, PARAM_RELOAD, &PreNickDBName}}},
515  {"NSEmailReg", {{PARAM_SET, PARAM_RELOAD, &NSEmailReg}}},
516  {"NickCoreModules", {{PARAM_STRING, PARAM_RELOAD, &NickCoreModules}}},
517  {"NickRegDelay", {{PARAM_POSINT, PARAM_RELOAD, &NickRegDelay}}},
518  {"NickServName", {{PARAM_STRING, 0, &s_NickServ},
519  {PARAM_STRING, 0, &desc_NickServ}}},
520  {"NickServAlias", {{PARAM_STRING, 0, &s_NickServAlias},
522  {"NoBackupOkay", {{PARAM_SET, PARAM_RELOAD, &NoBackupOkay}}},
523  {"NSAccessMax", {{PARAM_POSINT, PARAM_RELOAD, &NSAccessMax}}},
524  {"NSAllowKillImmed", {{PARAM_SET, 0, &NSAllowKillImmed}}},
525  {"NSDefHideEmail", {{PARAM_SET, PARAM_RELOAD, &NSDefHideEmail}}},
526  {"NSDefHideQuit", {{PARAM_SET, PARAM_RELOAD, &NSDefHideQuit}}},
527  {"NSDefHideUsermask", {{PARAM_SET, PARAM_RELOAD, &NSDefHideUsermask}}},
528  {"NSDefKill", {{PARAM_SET, PARAM_RELOAD, &NSDefKill}}},
529  {"NSDefKillQuick", {{PARAM_SET, PARAM_RELOAD, &NSDefKillQuick}}},
530  {"NSDefLanguage", {{PARAM_POSINT, PARAM_RELOAD, &NSDefLanguage}}},
531  {"NSDefMemoReceive", {{PARAM_SET, PARAM_RELOAD, &NSDefMemoReceive}}},
532  {"NSDefMemoSignon", {{PARAM_SET, PARAM_RELOAD, &NSDefMemoSignon}}},
533  {"NSDefMsg", {{PARAM_SET, PARAM_RELOAD, &NSDefMsg}}},
534  {"NSDefNone", {{PARAM_SET, PARAM_RELOAD, &NSDefNone}}},
535  {"NSDefPrivate", {{PARAM_SET, PARAM_RELOAD, &NSDefPrivate}}},
536  {"NSDefSecure", {{PARAM_SET, PARAM_RELOAD, &NSDefSecure}}},
537  {"NSDefAutoop", {{PARAM_SET, PARAM_RELOAD, &NSDefAutoop}}},
538  {"NSEnforcerUser", {{PARAM_STRING, PARAM_RELOAD, &temp_nsuserhost}}},
539  {"NSExpire", {{PARAM_TIME, PARAM_RELOAD, &NSExpire}}},
540  {"NSRExpire", {{PARAM_TIME, PARAM_RELOAD, &NSRExpire}}},
541  {"NSModeOnID", {{PARAM_SET, PARAM_RELOAD, &NSModeOnID}}},
542  {"NSForceEmail", {{PARAM_SET, PARAM_RELOAD, &NSForceEmail}}},
543  {"NSGuestNickPrefix",
545  {"NSListMax", {{PARAM_POSINT, PARAM_RELOAD, &NSListMax}}},
546  {"NSListOpersOnly", {{PARAM_SET, PARAM_RELOAD, &NSListOpersOnly}}},
547  {"NSMaxAliases", {{PARAM_INT, PARAM_RELOAD, &NSMaxAliases}}},
548  {"NSNoGroupChange", {{PARAM_SET, PARAM_RELOAD, &NSNoGroupChange}}},
549  {"NSRegDelay", {{PARAM_TIME, PARAM_RELOAD, &NSRegDelay}}},
550  {"NSResendDelay", {{PARAM_TIME, PARAM_RELOAD, &NSResendDelay}}},
551  {"NSReleaseTimeout", {{PARAM_TIME, PARAM_RELOAD, &NSReleaseTimeout}}},
552  {"NSSecureAdmins", {{PARAM_SET, PARAM_RELOAD, &NSSecureAdmins}}},
553  {"NSStrictPrivileges",
555  {"NSRestrictGetPass", {{PARAM_SET, PARAM_RELOAD, &NSRestrictGetPass}}},
556  {"NSNickTracking", {{PARAM_SET, PARAM_RELOAD, &NSNickTracking}}},
557  {"NSAddAccessOnReg", {{PARAM_SET, PARAM_RELOAD, &NSAddAccessOnReg}}},
558  {"OperCoreModules", {{PARAM_STRING, PARAM_RELOAD, &OperCoreModules}}},
559  {"OperServDB", {{PARAM_STRING, PARAM_RELOAD, &OperDBName}}},
560  {"OperServName", {{PARAM_STRING, 0, &s_OperServ},
561  {PARAM_STRING, 0, &desc_OperServ}}},
562  {"OperServAlias", {{PARAM_STRING, 0, &s_OperServAlias},
564  {"PIDFile", {{PARAM_STRING, 0, &PIDFilename}}},
565  {"ReadTimeout", {{PARAM_TIME, PARAM_RELOAD, &ReadTimeout}}},
566  {"RemoteServer", {{PARAM_STRING, 0, &RemoteServer},
567  {PARAM_PORT, 0, &RemotePort},
568  {PARAM_STRING, 0, &RemotePassword}}},
569  {"RemoteServer2", {{PARAM_STRING, 0, &RemoteServer2},
570  {PARAM_PORT, 0, &RemotePort2},
571  {PARAM_STRING, 0, &RemotePassword2}}},
572  {"RemoteServer3", {{PARAM_STRING, 0, &RemoteServer3},
573  {PARAM_PORT, 0, &RemotePort3},
574  {PARAM_STRING, 0, &RemotePassword3}}},
575  {"RestrictMail", {{PARAM_SET, PARAM_RELOAD, &RestrictMail}}},
576  {"RestrictOperNicks", {{PARAM_SET, PARAM_RELOAD, &RestrictOperNicks}}},
577  {"SendMailPath", {{PARAM_STRING, PARAM_RELOAD, &SendMailPath}}},
578  {"SendFrom", {{PARAM_STRING, PARAM_RELOAD, &SendFrom}}},
579  {"ServerDesc", {{PARAM_STRING, 0, &ServerDesc}}},
580  {"ServerName", {{PARAM_STRING, 0, &ServerName}}},
581  {"ServicesRoot", {{PARAM_STRING, PARAM_RELOAD, &ServicesRoot}}},
582  {"ServiceUser", {{PARAM_STRING, 0, &temp_userhost}}},
583  {"SessionLimitDetailsLoc",
585  {"OSOpersOnly", {{PARAM_SET, PARAM_RELOAD, &OSOpersOnly}}},
586  {"SessionLimitExceeded",
588  {"SessionAutoKillExpiry",
590  {"SGLineExpiry", {{PARAM_TIME, PARAM_RELOAD, &SGLineExpiry}}},
591  {"SQLineExpiry", {{PARAM_TIME, PARAM_RELOAD, &SQLineExpiry}}},
592  {"SZLineExpiry", {{PARAM_TIME, PARAM_RELOAD, &SZLineExpiry}}},
593  {"HideStatsO", {{PARAM_SET, PARAM_RELOAD, &HideStatsO}}},
594  {"GlobalOnCycle", {{PARAM_SET, PARAM_RELOAD, &GlobalOnCycle}}},
595  {"AnonymousGlobal", {{PARAM_SET, PARAM_RELOAD, &AnonymousGlobal}}},
596  {"GlobalOnCycleMessage",
598  {"GlobalOnCycleUP", {{PARAM_STRING, PARAM_RELOAD, &GlobalOnCycleUP}}},
599  {"StrictPasswords", {{PARAM_SET, PARAM_RELOAD, &StrictPasswords}}},
600  {"TimeoutCheck", {{PARAM_TIME, PARAM_RELOAD, &TimeoutCheck}}},
601  {"UpdateTimeout", {{PARAM_TIME, PARAM_RELOAD, &UpdateTimeout}}},
602  {"UseMail", {{PARAM_SET, PARAM_RELOAD, &UseMail}}},
603  {"UsePrivmsg", {{PARAM_SET, PARAM_RELOAD, &UsePrivmsg}}},
604  {"UseStrictPrivMsg", {{PARAM_SET, PARAM_RELOAD, &UseStrictPrivMsg}}},
605  {"UserKey1", {{PARAM_POSINT, PARAM_RELOAD, &UserKey1}}},
606  {"UserKey2", {{PARAM_POSINT, PARAM_RELOAD, &UserKey2}}},
607  {"UserKey3", {{PARAM_POSINT, PARAM_RELOAD, &UserKey3}}},
608  {"UseSVSHOLD", {{PARAM_SET, PARAM_RELOAD, &UseSVSHOLD}}},
609  {"UseSVS2MODE", {{PARAM_SET, PARAM_RELOAD, &UseSVS2MODE}}},
610  {"UseTokens", {{PARAM_SET, 0, &UseTokens}}},
611  {"UseTS6", {{PARAM_SET, 0, &UseTS6}}},
612  {"UnRestrictSAdmin", {{PARAM_SET, PARAM_RELOAD, &UnRestrictSAdmin}}},
613  {"WallAkillExpire", {{PARAM_SET, PARAM_RELOAD, &WallAkillExpire}}},
614  {"WallBadOS", {{PARAM_SET, PARAM_RELOAD, &WallBadOS}}},
615  {"WallDrop", {{PARAM_SET, PARAM_RELOAD, &WallDrop}}},
616  {"WallExceptionExpire",
618  {"WallForbid", {{PARAM_SET, PARAM_RELOAD, &WallForbid}}},
619  {"WallGetpass", {{PARAM_SET, PARAM_RELOAD, &WallGetpass}}},
620  {"WallOper", {{PARAM_SET, PARAM_RELOAD, &WallOper}}},
621  {"WallOSAkill", {{PARAM_SET, PARAM_RELOAD, &WallOSAkill}}},
622  {"WallOSClearmodes", {{PARAM_SET, PARAM_RELOAD, &WallOSClearmodes}}},
623  {"WallOSGlobal", {{PARAM_SET, PARAM_RELOAD, &WallOSGlobal}}},
624  {"WallOSKick", {{PARAM_SET, PARAM_RELOAD, &WallOSKick}}},
625  {"WallOSJupe", {{PARAM_SET, PARAM_RELOAD, &WallOSJupe}}},
626  {"WallOSMode", {{PARAM_SET, PARAM_RELOAD, &WallOSMode}}},
627  {"WallOSNoOp", {{PARAM_SET, PARAM_RELOAD, &WallOSNoOp}}},
628  {"WallOSRaw", {{PARAM_SET, PARAM_RELOAD, &WallOSRaw}}},
629  {"WallOSSGLine", {{PARAM_SET, PARAM_RELOAD, &WallOSSGLine}}},
630  {"WallOSSQLine", {{PARAM_SET, PARAM_RELOAD, &WallOSSQLine}}},
631  {"WallOSSZLine", {{PARAM_SET, PARAM_RELOAD, &WallOSSZLine}}},
632  {"WallSetpass", {{PARAM_SET, PARAM_RELOAD, &WallSetpass}}},
633  {"WallSGLineExpire", {{PARAM_SET, PARAM_RELOAD, &WallSGLineExpire}}},
634  {"WallSQLineExpire", {{PARAM_SET, PARAM_RELOAD, &WallSQLineExpire}}},
635  {"WallSZLineExpire", {{PARAM_SET, PARAM_RELOAD, &WallSZLineExpire}}},
636  {"WarningTimeout", {{PARAM_TIME, PARAM_RELOAD, &WarningTimeout}}},
637  {"GlobalOnDefcon", {{PARAM_SET, PARAM_RELOAD, &GlobalOnDefcon}}},
638  {"GlobalOnDefconMore",
640  {"DefconMessage", {{PARAM_STRING, PARAM_RELOAD, &DefconMessage}}},
641  {"UlineServers", {{PARAM_STRING, PARAM_RELOAD, &UlineServers}}},
642 };
643 
644 /*************************************************************************/
645 
646 /* Print an error message to the log (and the console, if open). */
647 
648 void error(int linenum, const char *message, ...)
649 {
650  char buf[4096];
651  va_list args;
652 
653  va_start(args, message);
654  vsnprintf(buf, sizeof(buf), message, args);
655  va_end(args);
656 
657 #ifndef NOT_MAIN
658  if (linenum)
659  alog("%s:%d: %s", SERVICES_CONF, linenum, buf);
660  else
661  alog("%s: %s", SERVICES_CONF, buf);
662  if (!nofork && isatty(2)) {
663 #endif
664  if (linenum)
665  fprintf(stderr, "%s:%d: %s\n", SERVICES_CONF, linenum, buf);
666  else
667  fprintf(stderr, "%s: %s\n", SERVICES_CONF, buf);
668 #ifndef NOT_MAIN
669  }
670 #endif
671 }
672 
673 /*************************************************************************/
674 
675 /* Parse a configuration line. Return 1 on success; otherwise, print an
676  * appropriate error message and return 0. Destroys the buffer by side
677  * effect.
678  */
679 
680 int parse_directive(Directive * d, char *dir, int ac, char *av[MAXPARAMS],
681  int linenum, int reload, char *s)
682 {
683  int retval = 1;
684  int i;
685  long val;
686  int optind;
687 
688  if (stricmp(dir, d->name) != 0)
689  return 1;
690  optind = 0;
691  for (i = 0; i < MAXPARAMS && d->params[i].type != PARAM_NONE; i++) {
692  if (reload && !(d->params[i].flags & PARAM_RELOAD))
693  continue;
694 
695  if (d->params[i].type == PARAM_SET) {
696  *(int *) d->params[i].ptr = 1;
697  continue;
698  }
699 #ifdef STREAMLINED
700  if (d->params[i].flags & PARAM_FULLONLY) {
701  error(linenum,
702  "Directive `%s' not available in STREAMLINED mode",
703  d->name);
704  break;
705  }
706 #endif
707 
708  /* Should we remove PARAM_DEPRECATED because it's
709  * useless right now? -GD */
710  if (d->params[i].type == PARAM_DEPRECATED) {
711  union func_union
712  {
713  void *ptr;
714  void (*func)(void);
715  } u;
716 
717  error(linenum, "Deprecated directive `%s' used", d->name);
718 
719  u.ptr = d->params[i].ptr;
720  u.func();
721  continue;
722  }
723  if (optind >= ac) {
724  if (!(d->params[i].flags & PARAM_OPTIONAL)) {
725  error(linenum, "Not enough parameters for `%s'", d->name);
726  retval = 0;
727  }
728  break;
729  }
730  switch (d->params[i].type) {
731  case PARAM_INT:
732  val = strtol(av[optind++], &s, 10);
733  if (*s) {
734  error(linenum,
735  "%s: Expected an integer for parameter %d",
736  d->name, optind);
737  retval = 0;
738  break;
739  }
740  *(int *) d->params[i].ptr = val;
741  break;
742  case PARAM_POSINT:
743  val = strtol(av[optind++], &s, 10);
744  if (*s || val <= 0) {
745  error(linenum,
746  "%s: Expected a positive integer for parameter %d",
747  d->name, optind);
748  retval = 0;
749  break;
750  }
751  if (errno == ERANGE && val == LONG_MAX) {
752  /* well the true top off is 2,147,483,647 but lets not give them the real top */
753  error(linenum,
754  "%s: paramter %d is to large, reduce this value (0 to 2,147,483,646)",
755  d->name, optind);
756  }
757  *(int *) d->params[i].ptr = val;
758  break;
759  case PARAM_PORT:
760  val = strtol(av[optind++], &s, 10);
761  if (*s) {
762  error(linenum,
763  "%s: Expected a port number for parameter %d",
764  d->name, optind);
765  retval = 0;
766  break;
767  }
768  if (val < 1 || val > 65535) {
769  error(linenum,
770  "Port numbers must be in the range 1..65535");
771  retval = 0;
772  break;
773  }
774  *(int *) d->params[i].ptr = val;
775  break;
776  case PARAM_STRING:
777  /*
778  * Anope_Free(*(char **)d->params[i].ptr);
779  * Historically dumb modules pass uninitialized values here so
780  * we can't free this
781  */
782  *(char **) d->params[i].ptr = sstrdup(av[optind++]);
783  if (!d->params[i].ptr) {
784  error(linenum, "%s: Out of memory", d->name);
785  return 0;
786  }
787  break;
788  case PARAM_TIME:
789  val = dotime(av[optind++]);
790  if (val < 0) {
791  error(linenum,
792  "%s: Expected a time value for parameter %d",
793  d->name, optind);
794  retval = 0;
795  break;
796  }
797  *(int *) d->params[i].ptr = val;
798  break;
799  default:
800  error(linenum, "%s: Unknown type %d for param %d",
801  d->name, d->params[i].type, i + 1);
802  retval = 0; /* don't bother continuing--something's bizarre */
803  break;
804  }
805  }
806  return retval;;
807 }
808 
809 
810 int parse(char *buf, int linenum, int reload)
811 {
812  char *s, *t, *dir;
813  int n;
814  int retval = 1;
815  int ac = 0;
816  char *av[MAXPARAMS];
817 
818  dir = strtok(buf, " \t\r\n");
819  s = strtok(NULL, "");
820  if (s) {
821  while (isspace(*s))
822  s++;
823  while (*s) {
824  if (ac >= MAXPARAMS) {
825  error(linenum, "Warning: too many parameters (%d max)",
826  MAXPARAMS);
827  break;
828  }
829  t = s;
830  if (*s == '"') {
831  t++;
832  s++;
833  while (*s && *s != '"') {
834  if (*s == '\\' && s[1] != 0)
835  s++;
836  s++;
837  }
838  if (!*s)
839  error(linenum,
840  "Warning: unterminated double-quoted string");
841  else
842  *s++ = 0;
843  } else {
844  s += strcspn(s, " \t\r\n");
845  if (*s)
846  *s++ = 0;
847  }
848  av[ac++] = t;
849  while (isspace(*s))
850  s++;
851  }
852  }
853 
854  if (!dir)
855  return 1;
856 
857  for (n = 0; n < lenof(directives); n++) {
858  Directive *d = &directives[n];
859  retval = parse_directive(d, dir, ac, av, linenum, reload, s);
860  if (!retval) {
861  break;
862  }
863  }
864 
865  return retval;
866 }
867 
868 
869 /*************************************************************************/
870 
871 #define CHECK(v) do { \
872  if (!v) { \
873  error(0, #v " missing"); \
874  retval = 0; \
875  } \
876 } while (0)
877 
878 #define CHEK2(v,n) do { \
879  if (!v) { \
880  error(0, #n " missing"); \
881  retval = 0; \
882  } \
883 } while (0)
884 
885 /* Read the entire configuration file. If an error occurs while reading
886  * the file or a required directive is not found, print and log an
887  * appropriate error message and return 0; otherwise, return 1.
888  *
889  * If reload is 1, will reload the configuration file.
890  * --lara
891  *
892  */
893 
894 int read_config(int reload)
895 {
896  FILE *config;
897  int linenum = 0, retval = 1;
898  char buf[1024], *s;
899  int defconCount = 0;
900 
901  if (reload) {
902  int i, n;
903 
904  /* Reset all the reloadable settings */
905 
906  for (n = 0; n < lenof(directives); n++) {
907  Directive *d = &directives[n];
908 
909  for (i = 0; i < MAXPARAMS && d->params[i].type != PARAM_NONE;
910  i++) {
911  if (!(d->params[i].flags & PARAM_RELOAD))
912  continue;
913 
914  if (d->params[i].type == PARAM_SET
915  || d->params[i].type == PARAM_INT
916  || d->params[i].type == PARAM_POSINT
917  || d->params[i].type == PARAM_TIME) {
918  *(int *) d->params[i].ptr = 0;
919  } else if (d->params[i].type == PARAM_STRING) {
920  if (*(char **) d->params[i].ptr)
921  free(*(char **) d->params[i].ptr);
922  (*(char **) d->params[i].ptr) = NULL;
923  }
924  }
925  }
926  }
927 
928  config = fopen(SERVICES_CONF, "r");
929  if (!config) {
930 #ifndef NOT_MAIN
931  log_perror("Can't open " SERVICES_CONF);
932  if (!nofork && isatty(2)) {
933 #endif
934  if (!reload)
935  perror("Can't open " SERVICES_CONF);
936  else
937  alog("Can't open %s", SERVICES_CONF);
938 #ifndef NOT_MAIN
939  }
940 #endif
941  return 0;
942  }
943  while (fgets(buf, sizeof(buf), config)) {
944  linenum++;
945  if (*buf == '#' || *buf == '\r' || *buf == '\n')
946  continue;
947  if (!parse(buf, linenum, reload))
948  retval = 0;
949  }
950  fclose(config);
951 
952  if (!reload) {
954  CHECK(ServerName);
955  CHECK(ServerDesc);
956 
957  if (RemoteServer3)
959 
960  if (LocalHost && RemoteServer) {
962  && LocalPort == RemotePort) {
963  printf
964  ("\n*** LocalAddress and RemoteServer are set to use the same IP address\n"
965  "*** (%s) and port (%d). This would have resulted in errors.\n"
966  "*** Change the LocalAddress to bind to another port.\n",
968  retval = 0;
969  }
970  }
971 
972  if (NickLen == 0) {
973  alog("You have not defined the NickLen configuration directive. It is strongly");
974  alog("advised that you do configure this correctly in your services.conf");
975  NickLen = NICKMAX - 1;
976  } else if ((NickLen < 1) || (NickLen >= NICKMAX)) {
977  alog("NickLen has an invalid value; setting to %d",
978  (NICKMAX - 1));
979  NickLen = NICKMAX - 1;
980  }
981  }
982 
983  CHECK(IRCDModule);
984  CHECK(EncModule);
985 
987  if (!reload) {
989  CHEK2(s_NickServ, NickServName);
990  CHEK2(s_ChanServ, ChanServName);
991  CHEK2(s_MemoServ, MemoServName);
992  CHEK2(s_HelpServ, HelpServName);
993  CHEK2(s_OperServ, OperServName);
994  CHEK2(s_GlobalNoticer, GlobalName);
995  CHEK2(PIDFilename, PIDFile);
996  }
997 
998  if (s_ChanServAlias) {
1000  printf
1001  ("\n*** ChanServ and ChanServ Alias are the same, this will cause errors\n");
1002  retval = 0;
1003  }
1004  }
1005 
1006  if (s_NickServAlias) {
1008  printf
1009  ("\n*** NickServ and NickServ Alias are the same, this will cause errors\n");
1010  retval = 0;
1011  }
1012  }
1013 
1014  if (s_OperServAlias) {
1016  printf
1017  ("\n*** OperServ and OperServ Alias are the same, this will cause errors\n");
1018  retval = 0;
1019  }
1020  }
1021 
1022  if (s_MemoServAlias) {
1024  printf
1025  ("\n*** MemoServ and MemoServ Alias are the same, this will cause errors\n");
1026  retval = 0;
1027  }
1028  }
1029 
1030  if (s_HelpServAlias) {
1032  printf
1033  ("\n*** HelpServ and HelpServ Alias are the same, this will cause errors\n");
1034  retval = 0;
1035  }
1036  }
1037 
1038  if (s_GlobalNoticerAlias) {
1040  printf
1041  ("\n*** GlobalNoticer and GlobalNoticer Alias are the same, this will cause errors\n");
1042  retval = 0;
1043  }
1044  }
1045 
1046 
1047  CHEK2(MOTDFilename, MOTDFile);
1048  if (!reload) {
1049  CHEK2(NickDBName, NickServDB);
1050  CHEK2(ChanDBName, ChanServDB);
1051  CHEK2(OperDBName, OperServDB);
1052  CHEK2(NewsDBName, NewsDB);
1053  CHEK2(ExceptionDBName, ExceptionDB);
1054  }
1057  CHECK(ReadTimeout);
1060  CHECK(NSAccessMax);
1063  CHECK(NSListMax);
1064  CHECK(CSAccessMax);
1067  CHECK(CSInhabit);
1068  CHECK(CSListMax);
1075 
1076  if (!reload) {
1077 
1078  if (temp_userhost) {
1079  if (!(s = strchr(temp_userhost, '@'))) {
1080  error(0, "Missing `@' for ServiceUser");
1081  } else {
1082  *s++ = 0;
1084  ServiceHost = s;
1085  }
1086  }
1087 
1088  }
1089 
1090  if (temp_nsuserhost) {
1091  if (!(s = strchr(temp_nsuserhost, '@'))) {
1094  } else {
1095  *s++ = 0;
1097  NSEnforcerHost = s;
1098  }
1099  }
1100 
1101  if (!NSDefNone &&
1102  !NSDefKill &&
1103  !NSDefKillQuick &&
1104  !NSDefSecure &&
1105  !NSDefPrivate &&
1106  !NSDefHideEmail &&
1107  !NSDefHideUsermask &&
1109  NSDefSecure = 1;
1110  NSDefMemoSignon = 1;
1111  NSDefMemoReceive = 1;
1112  }
1113 
1114  NSDefFlags = 0;
1115  if (!NSDefNone) {
1116  if (NSDefKill)
1118  if (NSDefKillQuick)
1120  if (NSDefSecure)
1121  NSDefFlags |= NI_SECURE;
1122  if (NSDefPrivate)
1124  if (NSDefMsg) {
1125  if (!UsePrivmsg)
1126  alog("NSDefMsg can only be used when UsePrivmsg is set - unsetting NSDefMsg");
1127  else
1128  NSDefFlags |= NI_MSG;
1129  }
1130  if (NSDefHideEmail)
1132  if (NSDefHideUsermask)
1134  if (NSDefHideQuit)
1136  if (NSDefMemoSignon)
1138  if (NSDefMemoReceive)
1140  if (!NSDefAutoop)
1141  NSDefFlags |= NI_AUTOOP;
1142  }
1143 
1144  if (!ServicesRoot) {
1145  error(0,
1146  "You must define the 'ServicesRoot' configuration directive");
1147  error(0,
1148  "in your services.conf file. This is a required setting that");
1149  error(0,
1150  "defines the main Administrative nick(s) Anope will obey.");
1151  retval = 0;
1152  }
1153 
1154  CHECK(NSGuestNickPrefix); /* Add safety check */
1155  if (NSGuestNickPrefix && (strlen(NSGuestNickPrefix) > 21)) {
1156  error(0, "Value of NSGuestNickPrefix must be between 1 and 21");
1157  retval = 0;
1158  }
1159 
1161  if (NSDefLanguage) {
1162  NSDefLanguage--;
1163  if (NSDefLanguage < 0 || NSDefLanguage >= NUM_LANGS) {
1164  error(0, "Value of NSDefLanguage must be between 1 and %d",
1165  USED_LANGS);
1166  retval = 0;
1167  }
1168  }
1169 
1170  if (!NewsCount) {
1171  NewsCount = 3;
1172  }
1173 
1174  if (reload) {
1175  if ((NSDefLanguage = langlist[NSDefLanguage]) < 0)
1176  NSDefLanguage = DEF_LANGUAGE;
1177  }
1178 
1179  if (CSDefBantype < 0 || CSDefBantype > 3) {
1180  error(0, "Value of CSDefBantype must be between 0 and 3 included");
1181  retval = 0;
1182  }
1183 
1184  if (!MysqlRetries || !MysqlRetryGap) {
1185  MysqlRetries = 5;
1186  MysqlRetryGap = 1;
1187  } else if (((MysqlRetries * MysqlRetryGap) > 60)
1188  || ((MysqlRetries * MysqlRetryGap) < 1)) {
1189  error(0,
1190  "MysqlRetries * MysqlRetryGap must be between 1 and 60, using standard values.");
1191  MysqlRetries = 5;
1192  MysqlRetryGap = 1;
1193  }
1194 
1195  if (!CSDefNone &&
1196  !CSDefKeepTopic &&
1197  !CSDefTopicLock &&
1198  !CSDefPrivate &&
1199  !CSDefRestricted &&
1200  !CSDefSecure &&
1201  !CSDefSecureOps &&
1202  !CSDefSecureFounder &&
1204  CSDefKeepTopic = 1;
1205  CSDefSecure = 1;
1206  CSDefSecureFounder = 1;
1207  CSDefSignKick = 1;
1208  }
1209 
1210  CSDefFlags = 0;
1211  if (!CSDefNone) {
1212  if (CSDefKeepTopic)
1214  if (CSDefTopicLock)
1216  if (CSDefPrivate)
1218  if (CSDefRestricted)
1220  if (CSDefSecure)
1221  CSDefFlags |= CI_SECURE;
1222  if (CSDefSecureOps)
1224  if (CSDefSecureFounder)
1226  if (CSDefSignKick)
1228  if (CSDefSignKickLevel)
1230  if (CSDefOpNotice)
1232  if (CSDefXOP)
1233  CSDefFlags |= CI_XOP;
1234  if (CSDefPeace)
1235  CSDefFlags |= CI_PEACE;
1236  }
1237 
1238  BSDefFlags = 0;
1239  if (BSDefDontKickOps)
1241  if (BSDefDontKickVoices)
1243  if (BSDefGreet)
1244  BSDefFlags |= BS_GREET;
1245  if (BSDefFantasy)
1247  if (BSDefSymbiosis)
1249 
1250  /* Services Root building */
1251 
1252  if (ServicesRoot && !reload) { /* Check to prevent segmentation fault if it's missing */
1253  while( RootNumber )
1254  free(ServicesRoots[--RootNumber]);
1255 
1256  s = strtok(ServicesRoot, " ");
1257  do {
1258  if (s) {
1259  RootNumber++;
1260  ServicesRoots =
1261  srealloc(ServicesRoots, sizeof(char *) * RootNumber);
1262  ServicesRoots[RootNumber - 1] = sstrdup(s);
1263  }
1264  } while ((s = strtok(NULL, " ")));
1265  }
1266 
1267  if (!RootNumber) {
1268  error(0, "No ServicesRoot defined");
1269  retval = 0;
1270  }
1271 
1272  /* Ulines */
1273 
1274  if (UlineServers) {
1275  while( NumUlines )
1276  free(Ulines[--NumUlines]);
1277 
1278  s = strtok(UlineServers, " ");
1279  do {
1280  if (s) {
1281  NumUlines++;
1282  Ulines = srealloc(Ulines, sizeof(char *) * NumUlines);
1283  Ulines[NumUlines - 1] = sstrdup(s);
1284  }
1285  } while ((s = strtok(NULL, " ")));
1286  }
1287 
1288  /* Host Setters building... :P */
1289  while( HostNumber )
1290  free(HostSetters[--HostNumber]);
1293 
1294  /* Modules Autoload building... :P */
1295  while( ModulesNumber )
1296  free(ModulesAutoload[--ModulesNumber]);
1299 
1300  while( ModulesDelayedNumber )
1304 
1305  while( HostServCoreNumber )
1309 
1310  while( MemoServCoreNumber )
1314 
1315  while( HelpServCoreNumber )
1319 
1320  while( BotServCoreNumber )
1324 
1325  while( OperServCoreNumber )
1329 
1330  while( ChanServCoreNumber )
1334 
1335  while( NickServCoreNumber )
1339 
1340 
1341  if (LimitSessions) {
1345 
1347  SessionAutoKillExpiry = 30 * 60; /* 30 minutes */
1348  }
1349 
1350  if (s_BotServ) {
1351  CHEK2(BotDBName, BotServDB);
1353  CHECK(BSMinUsers);
1354  CHECK(BSKeepData);
1355  if (s_BotServAlias) {
1356  if (!stricmp(s_BotServ, s_BotServAlias)) {
1357  printf
1358  ("\n*** BotServ and BotServ Alias are the same, this will cause errors\n");
1359  retval = 0;
1360  }
1361  }
1362  if (!BSFantasyCharacter)
1363  BSFantasyCharacter = sstrdup("!");
1364  if (BSFantasyCharacter && (strlen(BSFantasyCharacter) > 1)) {
1365  printf
1366  ("*** BSFantasyCharacter is more than 1 character long. Only the first\n"
1367  "*** character ('%c') will be used. The others will be ignored.\n",
1369  }
1370  }
1371 
1372  if (s_HostServ) {
1373  CHEK2(s_HostServ, HostServName);
1374  CHEK2(HostDBName, HostServDB);
1375 
1376  if (s_HostServAlias) {
1378  printf
1379  ("\n*** HostServ and HostServ Alias are the same, this will cause errors\n");
1380  retval = 0;
1381  }
1382  }
1383  }
1384 
1385  if (UseMail) {
1387  CHECK(SendFrom);
1388  }
1389 
1390  if (GlobalOnCycle) {
1392  alog("GlobalOnCycleMessage and GlobalOnCycleUP are not defined; disabling GlobalOnCycle");
1393  GlobalOnCycle = 0;
1394  }
1395  }
1396 
1397  /* Check the user keys */
1398  if ((UserKey1 == UserKey2) || (UserKey1 == UserKey3)
1399  || (UserKey3 == UserKey2))
1400  alog("Every UserKey must be different. It's for YOUR safety! Remember that!");
1401 
1405  if (DefConLevel) {
1406  CHECK(DefCon1);
1407  CHECK(DefCon2);
1408  CHECK(DefCon3);
1409  CHECK(DefCon4);
1410  DefCon5 = 0; /* ALWAYS have defcon 5 as normal operation */
1411  /* Build DefCon's */
1412  DefCon[0] = 0;
1413  DefCon[1] = DefCon1;
1414  DefCon[2] = DefCon2;
1415  DefCon[3] = DefCon3;
1416  DefCon[4] = DefCon4;
1417  DefCon[5] = DefCon5;
1418  for (defconCount = 1; defconCount <= 5; defconCount++) { /* Check any defcon needed settings */
1419  if (DefCon[defconCount] & DEFCON_REDUCE_SESSION) {
1421  }
1422  if (DefCon[defconCount] & DEFCON_AKILL_NEW_CLIENTS) {
1423  CHECK(DefConAKILL);
1425  }
1426  if (DefCon[defconCount] & DEFCON_FORCE_CHAN_MODES) {
1428  }
1429  }
1430  if (GlobalOnDefconMore)
1432  }
1433 
1440  if (NSEmailReg) {
1441  CHEK2(PreNickDBName, PreNickServDB);
1442  CHECK(NSEmailReg);
1443  CHECK(NSRExpire);
1444  CHECK(UseMail);
1446  } else {
1448  PreNickDBName = NULL;
1449  NSRExpire = 0;
1450  }
1451 
1452  if (!retval) {
1453  printf
1454  ("\n*** Support resources: Read through the services.conf self-contained \n*** documentation. Read the documentation files found in the 'docs' \n*** folder. Visit our portal located at http://www.anope.org/. Join \n*** our support channel on /server irc.anope.org channel #anope.\n\n");
1455  }
1456 
1457  return retval;
1458 }
1459 
1460 
1461 /*************************************************************************/
int CSDefPeace
Definition: config.c:173
int SQLineExpiry
Definition: config.c:231
int DefSessionLimit
Definition: config.c:261
int LogUsers
Definition: config.c:117
int OSOpersOnly
Definition: config.c:270
int CSRestrictGetPass
Definition: config.c:193
char * s_MemoServAlias
Definition: config.c:71
int CSDefSignKickLevel
Definition: config.c:180
char * RemoteServer3
Definition: config.c:30
int DontQuoteAddresses
Definition: config.c:129
int NSAddAccessOnReg
Definition: config.c:168
char * NSEnforcerUser
Definition: config.c:156
#define BS_FANTASY
Definition: services.h:795
int LogMaxUsers
Definition: config.c:226
int WallForbid
Definition: config.c:255
int NSAccessMax
Definition: config.c:155
int DefCon5
Definition: config.c:327
char * MysqlSecure
Definition: config.c:316
#define Anope_Free(x)
Definition: extern.h:1391
int ModulesDelayedNumber
Definition: config.c:276
char * RemotePassword3
Definition: config.c:32
int HostNumber
Definition: config.c:100
int OperServCoreNumber
Definition: config.c:300
int WarningTimeout
Definition: config.c:109
int CSDefNone
Definition: config.c:170
int HelpServCoreNumber
Definition: config.c:292
char * AutokillDBName
Definition: config.c:95
int WallOSMode
Definition: config.c:239
char * IRCDModule
Definition: config.c:20
char ** NickServCoreModules
Definition: config.c:303
int WallSGLineExpire
Definition: config.c:250
int UseStrictPrivMsg
Definition: config.c:115
int NSDefHideEmail
Definition: config.c:141
int NickServCoreNumber
Definition: config.c:304
int DisableRaw
Definition: config.c:227
int CSDefBantype
Definition: config.c:186
#define PARAM_POSINT
Definition: services.h:441
char * ServicesRoot
Definition: config.c:221
int SGLineExpiry
Definition: config.c:230
int HideStatsO
Definition: config.c:215
int BSDefFantasy
Definition: config.c:203
char * desc_MemoServAlias
Definition: config.c:80
char * MysqlName
Definition: config.c:314
char * DefConChanModes
Definition: config.c:332
#define CI_OPNOTICE
Definition: services.h:733
int RemotePort2
Definition: config.c:27
int LogBot
Definition: config.c:225
int KeepBackups
Definition: config.c:112
#define DEFCON_FORCE_CHAN_MODES
Definition: services.h:1257
long unsigned int UserKey2
Definition: config.c:340
#define PARAM_NONE
Definition: services.h:439
int SessionAutoKillExpiry
Definition: config.c:265
int DefCon4
Definition: config.c:326
int BSBadWordsMax
Definition: config.c:209
char * s_NickServ
Definition: config.c:48
char * desc_ChanServAlias
Definition: config.c:79
int BSMinUsers
Definition: config.c:208
int CSDefTopicLock
Definition: config.c:181
char * s_HostServAlias
Definition: config.c:77
#define CI_RESTRICTED
Definition: services.h:719
int NewsCount
Definition: config.c:122
int BadPassTimeout
Definition: config.c:105
int WallExceptionExpire
Definition: config.c:253
#define lenof(a)
Definition: defs.h:30
static int NSDefNone
Definition: config.c:132
int UpdateTimeout
Definition: config.c:106
int AkillOnAdd
Definition: config.c:233
char * desc_HelpServ
Definition: config.c:60
#define PARAM_DEPRECATED
Definition: services.h:448
#define PARAM_TIME
Definition: services.h:444
long unsigned int UserKey3
Definition: config.c:341
int BSDefDontKickOps
Definition: config.c:201
int NSAllowKillImmed
Definition: config.c:134
int DumpCore
Definition: config.c:116
#define NI_MEMO_RECEIVE
Definition: services.h:1295
int KillonSGline
Definition: config.c:234
char * desc_DevNullAlias
Definition: config.c:85
E int dotime(const char *s)
Definition: misc.c:364
int RestrictMail
Definition: config.c:127
char * OperCoreModules
Definition: config.c:298
int UsePrivmsg
Definition: config.c:114
int BSDefGreet
Definition: config.c:204
char * GlobalOnCycleUP
Definition: config.c:220
int SuperAdmin
Definition: config.c:224
int MysqlPort
Definition: config.c:315
void * ptr
Definition: services.h:435
E int stricmp(const char *s1, const char *s2)
Definition: compat.c:58
int WallAkillExpire
Definition: config.c:249
int RemotePort3
Definition: config.c:31
int CSOpersOnly
Definition: config.c:194
int DefCon[6]
Definition: config.c:328
char * desc_ChanServ
Definition: config.c:57
int UseTS6
Definition: config.c:351
char * BSFantasyCharacter
Definition: config.c:213
char * MemoCoreModules
Definition: config.c:286
char * s_HelpServAlias
Definition: config.c:73
#define CI_SECURE
Definition: services.h:723
E int nofork
Definition: extern.h:779
#define CI_SECUREFOUNDER
Definition: services.h:735
int MysqlRetries
Definition: config.c:318
char * s_OperServAlias
Definition: config.c:74
char * s_DevNull
Definition: config.c:55
#define CI_SECUREOPS
Definition: services.h:713
char * EncModule
Definition: config.c:21
int LocalPort
Definition: config.c:35
int MSMemoReceipt
Definition: config.c:199
char * MysqlSock
Definition: config.c:317
int NSNoGroupChange
Definition: config.c:135
int NSStrictPrivileges
Definition: config.c:163
int WallOSRaw
Definition: config.c:248
char * s_ChanServAlias
Definition: config.c:70
E int langlist[NUM_LANGS]
Definition: extern.h:728
int CSDefOpNotice
Definition: config.c:172
char * SendMailPath
Definition: config.c:125
int linenum
Definition: langcomp.c:53
#define PARAM_RELOAD
Definition: services.h:454
int MemoServCoreNumber
Definition: config.c:288
#define SERVICES_CONF
Definition: config.h:25
int WallOSSZLine
Definition: config.c:245
#define NI_HIDE_QUIT
Definition: services.h:1299
int GlobalOnDefcon
Definition: config.c:333
int BSDefSymbiosis
Definition: config.c:205
#define NI_KILLPROTECT
Definition: services.h:1290
char ** HostSetters
Definition: config.c:99
int CSDefSecureOps
Definition: config.c:177
int NSRestrictGetPass
Definition: config.c:166
#define NUM_LANGS
Definition: services.h:1333
int UseMail
Definition: config.c:124
char * ChanCoreModules
Definition: config.c:306
char * s_NickServAlias
Definition: config.c:69
int NSDefLanguage
Definition: config.c:147
int WallSQLineExpire
Definition: config.c:251
#define MAXPARAMS
Definition: services.h:426
char * ExceptionDBName
Definition: config.c:266
int CSListOpersOnly
Definition: config.c:191
char * desc_DevNull
Definition: config.c:63
char * UlineServers
Definition: config.c:347
int BSKeepData
Definition: config.c:207
int CSDefXOP
Definition: config.c:182
char * GlobalOnCycleMessage
Definition: config.c:219
char * desc_GlobalNoticerAlias
Definition: config.c:84
int NSResendDelay
Definition: config.c:150
char * MysqlHost
Definition: config.c:311
int HostServCoreNumber
Definition: config.c:284
#define NI_PRIVATE
Definition: services.h:1296
int ModulesNumber
Definition: config.c:275
int WallOSKick
Definition: config.c:241
char * Modules
Definition: config.c:272
E char * sstrdup(const char *s)
Definition: memory.c:105
#define CI_PRIVATE
Definition: services.h:715
char * SessionLimitExceeded
Definition: config.c:267
char * DefConAKILL
Definition: config.c:331
char * desc_HostServ
Definition: config.c:67
#define CI_PEACE
Definition: services.h:721
int ForceForbidReason
Definition: config.c:113
#define PARAM_PORT
Definition: services.h:442
int BotServCoreNumber
Definition: config.c:296
int WallDrop
Definition: config.c:254
#define USED_LANGS
Definition: services.h:1334
#define NI_HIDE_EMAIL
Definition: services.h:1297
int NSReleaseTimeout
Definition: config.c:159
int read_config(int reload)
Definition: config.c:894
char * NewsDBName
Definition: config.c:96
int WallOper
Definition: config.c:236
int DefConLevel
Definition: config.c:322
int WallOSAkill
Definition: config.c:242
static char * temp_userhost
Definition: config.c:41
int NSExpire
Definition: config.c:151
int CSDefSecureFounder
Definition: config.c:178
int WallOSJupe
Definition: config.c:247
char * HostSetter
Definition: config.c:98
char * ServerDesc
Definition: config.c:38
#define DEFCON_REDUCE_SESSION
Definition: services.h:1258
char * RemoteServer2
Definition: config.c:26
char * DefConAkillReason
Definition: config.c:337
#define NI_MEMO_SIGNON
Definition: services.h:1294
char * ModulesDelayed
Definition: config.c:273
int BSDefDontKickVoices
Definition: config.c:202
long unsigned int UserKey1
Definition: config.c:339
int CSDefPrivate
Definition: config.c:174
int UseSVS2MODE
Definition: config.c:121
char * MOTDFilename
Definition: config.c:89
char * s_BotServ
Definition: config.c:51
char * HelpChannel
Definition: config.c:43
char * desc_BotServ
Definition: config.c:59
char * HostDBName
Definition: config.c:65
char * LogChannel
Definition: config.c:44
int NSEmailReg
Definition: config.c:164
Directive directives[]
Definition: config.c:362
int WallOSClearmodes
Definition: config.c:240
#define NI_HIDE_MASK
Definition: services.h:1298
char * s_MemoServ
Definition: config.c:50
char * ServerName
Definition: config.c:37
int WallOSSGLine
Definition: config.c:243
char * HelpCoreModules
Definition: config.c:290
int MSMaxMemos
Definition: config.c:196
int CSExpire
Definition: config.c:185
#define DEFCON_AKILL_NEW_CLIENTS
Definition: services.h:1262
char * PIDFilename
Definition: config.c:88
int CSListMax
Definition: config.c:192
char * MysqlPass
Definition: config.c:313
char ** ModulesAutoload
Definition: config.c:274
char * s_HostServ
Definition: config.c:66
int CSMaxReg
Definition: config.c:184
char * BotCoreModules
Definition: config.c:294
char * s_GlobalNoticerAlias
Definition: config.c:75
int NSDefPrivate
Definition: config.c:139
int MysqlRetryGap
Definition: config.c:319
#define CI_KEEPTOPIC
Definition: services.h:711
int parse(char *buf, int linenum, int reload)
Definition: config.c:810
int NSDefFlags
Definition: config.c:146
int NSListOpersOnly
Definition: config.c:160
char * ServiceUser
Definition: config.c:39
char ** MemoServCoreModules
Definition: config.c:287
int UseTokens
Definition: config.c:120
int NSForceEmail
Definition: config.c:153
int DefConSessionLimit
Definition: config.c:330
char * SessionLimitDetailsLoc
Definition: config.c:268
int NSDefMemoSignon
Definition: config.c:144
E void alog(const char *fmt,...) FORMAT(printf
int GlobalOnCycle
Definition: config.c:216
int AutokillExpiry
Definition: config.c:228
int StrictPasswords
Definition: config.c:103
int NSDefMsg
Definition: config.c:140
#define CI_XOP
Definition: services.h:741
int CSDefSecure
Definition: config.c:176
#define BS_DONTKICKOPS
Definition: services.h:793
int NSDefKillQuick
Definition: config.c:137
int RootNumber
Definition: config.c:223
char * desc_NickServ
Definition: config.c:56
char * NickDBName
Definition: config.c:90
char * OperDBName
Definition: config.c:94
#define CHEK2(v, n)
Definition: config.c:878
char * Numeric
Definition: config.c:343
char * desc_BotServAlias
Definition: config.c:81
int NSMaxAliases
Definition: config.c:154
int LimitSessions
Definition: config.c:260
int NSSecureAdmins
Definition: config.c:162
char * s_ChanServ
Definition: config.c:49
char * RemotePassword
Definition: config.c:24
int RestrictOperNicks
Definition: config.c:218
int RemotePort
Definition: config.c:23
#define NI_MSG
Definition: services.h:1292
int BSSmartJoin
Definition: config.c:210
int CSDefRestricted
Definition: config.c:175
int AnonymousGlobal
Definition: config.c:217
#define PARAM_SET
Definition: services.h:446
int ReadTimeout
Definition: config.c:108
#define CI_SIGNKICK
Definition: services.h:737
int ExceptionExpiry
Definition: config.c:262
#define NI_AUTOOP
Definition: services.h:1309
#define CI_SIGNKICK_LEVEL
Definition: services.h:739
int parse_directive(Directive *d, char *dir, int ac, char *av[MAXPARAMS], int linenum, int reload, char *s)
Definition: config.c:680
#define CHECK(v)
Definition: config.c:871
int TimeoutCheck
Definition: config.c:110
int NSRExpire
Definition: config.c:152
int DefCon2
Definition: config.c:324
#define DEF_LANGUAGE
Definition: services.h:1337
int NSDefMemoReceive
Definition: config.c:145
int KeepLogs
Definition: config.c:111
char * s_GlobalNoticer
Definition: config.c:54
int ForkForMail
Definition: config.c:130
char * NickCoreModules
Definition: config.c:302
char * NSEnforcerHost
Definition: config.c:157
char ** HostServCoreModules
Definition: config.c:283
char * desc_HelpServAlias
Definition: config.c:82
#define NI_SECURE
Definition: services.h:1291
char * desc_NickServAlias
Definition: config.c:78
char * ServiceHost
Definition: config.c:40
char ** OperServCoreModules
Definition: config.c:299
int ChanServCoreNumber
Definition: config.c:308
int KillonSQline
Definition: config.c:235
int UnRestrictSAdmin
Definition: config.c:345
E int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
char ** ModulesDelayedAutoload
Definition: config.c:277
int NickRegDelay
Definition: config.c:118
char ** HelpServCoreModules
Definition: config.c:291
int AddAkiller
Definition: config.c:258
int WallGetpass
Definition: config.c:256
char * s_DevNullAlias
Definition: config.c:76
int NSDefSecure
Definition: config.c:138
#define NICKMAX
Definition: config.h:62
char * RemoteServer
Definition: config.c:22
int NSDefHideQuit
Definition: config.c:143
int CSDefFlags
Definition: config.c:183
int DefCon3
Definition: config.c:325
char * NetworkName
Definition: config.c:45
int WallSetpass
Definition: config.c:257
#define CI_TOPICLOCK
Definition: services.h:717
int NSModeOnID
Definition: config.c:165
int UseRDB
Definition: config.c:320
char * CSAutokickReason
Definition: config.c:189
int MaxSessionLimit
Definition: config.c:264
struct Directive::@0 params[MAXPARAMS]
int DefCon1
Definition: config.c:323
int BadPassLimit
Definition: config.c:104
int NSDefAutoop
Definition: config.c:148
char * name
Definition: services.h:431
int NSListMax
Definition: config.c:161
E void * srealloc(void *oldptr, long newsize)
Definition: memory.c:80
int type
Definition: services.h:433
char * ChanDBName
Definition: config.c:92
char * BotDBName
Definition: config.c:93
int NumUlines
Definition: config.c:349
char * PreNickDBName
Definition: config.c:91
char * DefConTimeOut
Definition: config.c:329
#define PARAM_FULLONLY
Definition: services.h:453
int WallOSNoOp
Definition: config.c:246
int NSDefKill
Definition: config.c:136
int CSDefKeepTopic
Definition: config.c:171
#define PARAM_STRING
Definition: services.h:443
int NSRegDelay
Definition: config.c:149
char ** ChanServCoreModules
Definition: config.c:307
int GlobalOnDefconMore
Definition: config.c:334
void error(int linenum, const char *message,...)
Definition: config.c:648
char * desc_OperServ
Definition: config.c:61
#define PARAM_OPTIONAL
Definition: services.h:452
E char ** buildStringList(char *src, int *number)
Definition: misc.c:1211
char ** ServicesRoots
Definition: config.c:222
int CSAccessMax
Definition: config.c:187
char * RemotePassword2
Definition: config.c:28
int flags
Definition: services.h:434
char ** BotServCoreModules
Definition: config.c:295
int ChankillExpiry
Definition: config.c:229
int CSDefSignKick
Definition: config.c:179
int NSNickTracking
Definition: config.c:167
int MaxSessionKill
Definition: config.c:263
E void E void log_perror(const char *fmt,...) FORMAT(printf
char ** Ulines
Definition: config.c:348
int UseSVSHOLD
Definition: config.c:119
int WallOSGlobal
Definition: config.c:238
char * desc_HostServAlias
Definition: config.c:86
int NickLen
Definition: config.c:46
char * s_HelpServ
Definition: config.c:52
int BSGentleBWReason
Definition: config.c:211
char * SendFrom
Definition: config.c:126
int WallBadOS
Definition: config.c:237
int NSDefHideUsermask
Definition: config.c:142
char * desc_OperServAlias
Definition: config.c:83
char * DefconMessage
Definition: config.c:336
int WallSZLineExpire
Definition: config.c:252
char * LocalHost
Definition: config.c:34
int NoBackupOkay
Definition: config.c:102
char * desc_GlobalNoticer
Definition: config.c:62
int MailDelay
Definition: config.c:128
int CSAutokickMax
Definition: config.c:188
int BSCaseSensitive
Definition: config.c:212
char * MysqlUser
Definition: config.c:312
char * NSGuestNickPrefix
Definition: config.c:133
#define BS_GREET
Definition: services.h:797
int WallOSSQLine
Definition: config.c:244
int MSSendDelay
Definition: config.c:197
char * DefConOffMessage
Definition: config.c:335
#define NI_KILL_QUICK
Definition: services.h:1300
int CSInhabit
Definition: config.c:190
int MSNotifyAll
Definition: config.c:198
char * s_BotServAlias
Definition: config.c:72
char * HostCoreModules
Definition: config.c:282
int ExpireTimeout
Definition: config.c:107
#define BS_SYMBIOSIS
Definition: services.h:796
int SZLineExpiry
Definition: config.c:232
#define BS_DONTKICKVOICES
Definition: services.h:794
int BSDefFlags
Definition: config.c:206
static char * temp_nsuserhost
Definition: config.c:158
char * desc_MemoServ
Definition: config.c:58
#define PARAM_INT
Definition: services.h:440
char * s_OperServ
Definition: config.c:53