X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconf.c;h=bdbb506fcfcd39e391b6f967078804c10167a65d;hp=16275877a8d9e95f37cbf57ac1b395d55bb86d78;hb=86bdf6e1d4539da1076afe10b57b177fb54dd147;hpb=bd33bd770decd470577487fa4bd399cb1d8426fc diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index 16275877..bdbb506f 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -369,6 +369,7 @@ Conf_Test( void ) printf(" MotdPhrase = %s\n", array_bytes(&Conf_Motd) ? (const char*) array_start(&Conf_Motd) : ""); } + printf(" Network = %s\n", Conf_Network); #ifndef PAM printf(" Password = %s\n", Conf_ServerPwd); #endif @@ -749,6 +750,7 @@ Set_Defaults(bool InitServers) strcpy(Conf_ServerAdminMail, ""); snprintf(Conf_ServerInfo, sizeof Conf_ServerInfo, "%s %s", PACKAGE_NAME, PACKAGE_VERSION); + strcpy(Conf_Network, ""); free(Conf_ListenAddress); Conf_ListenAddress = NULL; array_free(&Conf_ListenPorts); @@ -1409,6 +1411,7 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg ) struct group *grp; size_t len; const char *section; + char *ptr; assert(File != NULL); assert(Line > 0); @@ -1491,6 +1494,19 @@ Handle_GLOBAL(const char *File, int Line, char *Var, char *Arg ) Using_MotdFile = false; return; } + if (strcasecmp(Var, "Network") == 0) { + len = strlcpy(Conf_Network, Arg, sizeof(Conf_Network)); + if (len >= sizeof(Conf_Network)) + Config_Error_TooLong(File, Line, Var); + ptr = strchr(Conf_Network, ' '); + if (ptr) { + Config_Error(LOG_WARNING, + "%s, line %d: \"Network\" can't contain spaces!", + File, Line); + *ptr = '\0'; + } + return; + } if(strcasecmp(Var, "Password") == 0) { len = strlcpy(Conf_ServerPwd, Arg, sizeof(Conf_ServerPwd)); if (len >= sizeof(Conf_ServerPwd))