summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2019-06-29 16:02:52 +0200
committerAlexander Barton <alex@barton.de>2019-06-29 16:02:52 +0200
commitf8002057f20e71f24b52c3aab5df3dc1760a151e (patch)
tree595c77e2c94e9662efcf82fd99b76f3a10249a1d /src
parent13122bc97d13c2630ab4b25a621486d0b7a0d134 (diff)
downloadngircd-f8002057f20e71f24b52c3aab5df3dc1760a151e.tar.gz
ngircd-f8002057f20e71f24b52c3aab5df3dc1760a151e.zip
Streamline handling of invalid and unset server name
Don't exit during runtime (REHASH command, HUP signal), because the
server name can't be changed in this case anyway and the new invalid
name will be ignored.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/conf.c17
-rw-r--r--src/ngircd/sighandlers.c2
2 files changed, 3 insertions, 16 deletions
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index 59a8ef9e..ef36a2fe 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -2234,7 +2234,8 @@ Validate_Config(bool Configtest, bool Rehash)
 		break;
 	} while (*(++ptr));
 
-	if (!Conf_ServerName[0]) {
+	if (!Conf_ServerName[0] || !strchr(Conf_ServerName, '.'))
+	{
 		/* No server name configured! */
 		config_valid = false;
 		Config_Error(LOG_ALERT,
@@ -2248,20 +2249,6 @@ Validate_Config(bool Configtest, bool Rehash)
 		}
 	}
 
-	if (Conf_ServerName[0] && !strchr(Conf_ServerName, '.')) {
-		/* No dot in server name! */
-		config_valid = false;
-		Config_Error(LOG_ALERT,
-			     "Invalid server name configured in \"%s\" (section 'Global': 'Name'): Dot missing!",
-			     NGIRCd_ConfFile);
-		if (!Configtest) {
-			Config_Error(LOG_ALERT,
-				     "%s exiting due to fatal errors!",
-				     PACKAGE_NAME);
-			exit(1);
-		}
-	}
-
 #ifdef STRICT_RFC
 	if (!Conf_ServerAdminMail[0]) {
 		/* No administrative contact configured! */
diff --git a/src/ngircd/sighandlers.c b/src/ngircd/sighandlers.c
index e352d586..6244846f 100644
--- a/src/ngircd/sighandlers.c
+++ b/src/ngircd/sighandlers.c
@@ -119,7 +119,7 @@ Rehash(void)
 	if (strcmp(old_name, Conf_ServerName) != 0 ) {
 		strlcpy(Conf_ServerName, old_name, sizeof Conf_ServerName);
 		Log(LOG_ERR,
-		    "Can't change \"ServerName\" on runtime! Ignored new name.");
+		    "Can't change server name (\"Name\") on runtime! Ignored new name.");
 	}
 	if (old_nicklen != Conf_MaxNickLength) {
 		Conf_MaxNickLength = old_nicklen;