repo: ngircd
action: commit
revision: 
path_from: 
revision_from: e541da2a8fb12a19b819f06d67403c094e474206:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit e541da2a8fb12a19b819f06d67403c094e474206
Author: Alexander Barton 
Date:   Tue Apr 29 12:36:09 2003 +0000

    "ServerName" is checked better now: a dot (".") is required.

diff --git a/ChangeLog b/ChangeLog
index 5ff1171e4eece69407d50e1e4b9d388551860781..
index ..2b8845a6585a8a1410ab2aa8bd91c1ed7fc1ecc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@ ngIRCd CVS-HEAD
   - (none)

 ngIRCd 0.7.0
+  - "ServerName" is checked better now: a dot (".") is required.
   - The KILL comand verifies and logs more parameters.

   ngIRCd 0.7.0-pre2
@@ -450,4 +451,4 @@ ngIRCd 0.0.1, 31.12.2001


 -- 
-$Id: ChangeLog,v 1.199 2003/04/29 12:19:20 alex Exp $
+$Id: ChangeLog,v 1.200 2003/04/29 12:36:09 alex Exp $
diff --git a/doc/sample-ngircd.conf b/doc/sample-ngircd.conf
index 186a4ed6b5c98c5dbb4efcea68e09e87d21ce2b5..
index ..ca5c29926403a21db0ccad7c487d958542f19a51 100644
--- a/doc/sample-ngircd.conf
+++ b/doc/sample-ngircd.conf
@@ -1,4 +1,4 @@
-# $Id: sample-ngircd.conf,v 1.21 2003/04/27 11:45:27 alex Exp $
+# $Id: sample-ngircd.conf,v 1.22 2003/04/29 12:36:09 alex Exp $

 #
 # This is a sample configuration file for the ngIRCd, which must adept to
@@ -16,7 +16,8 @@
 	# configuration of the server, like the server name and the ports
 	# on which the server should be listening.

-	# Server name in the IRC-network
+	# Server name in the IRC network, must contain at least one dot
+	# (".") and be unique in the IRC network.
 	Name = irc.the.net

 	# Info text of the server. This will be shown by WHOIS and
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index 9587b5fabb40c5bad09452f9b3f8f9967c37f2ee..
index ..00b5bb795274a4dc3fa280c5cca4c936fbbb8e89 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -14,7 +14,7 @@

 #include "portab.h"

-static char UNUSED id[] = "$Id: conf.c,v 1.58 2003/04/27 11:46:52 alex Exp $";
+static char UNUSED id[] = "$Id: conf.c,v 1.59 2003/04/29 12:36:09 alex Exp $";

 #include "imp.h"
 #include 
@@ -837,6 +837,17 @@ Validate_Config( BOOLEAN Configtest )
 			exit( 1 );
 		}
 	}
+	
+	if( ! strchr( Conf_ServerName, '.' ))
+	{
+		/* No dot in server name! */
+		Config_Error( LOG_ALERT, "Invalid server name configured in \"%s\" ('ServerName'): 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] )

-----END OF PAGE-----