]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Warn about duplicate <type> and <class> blocks
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 8 Mar 2010 17:15:52 +0000 (17:15 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 8 Mar 2010 17:15:52 +0000 (17:15 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12614 e03df62e-2008-0410-955e-edbf42e46eb7

src/configreader.cpp

index 1905b36d083412fb62e67c06550fe10f0c24a51e..696b19a1b1cb899e2d38c5b4839ee2b32badc86c 100644 (file)
@@ -185,6 +185,8 @@ void ServerConfig::CrossCheckOperClassType()
                std::string name = tag->getString("name");
                if (name.empty())
                        throw CoreException("<class:name> missing from tag at " + tag->getTagLocation());
+               if (operclass.find(name) != oper_blocks.end())
+                       throw CoreException("Duplicate class block with name " + name + " at " + tag->getTagLocation());
                operclass[name] = tag;
        }
        tags = ConfTags("type");
@@ -194,9 +196,10 @@ void ServerConfig::CrossCheckOperClassType()
                std::string name = tag->getString("name");
                if (name.empty())
                        throw CoreException("<type:name> is missing from tag at " + tag->getTagLocation());
-
                if (!ServerInstance->IsNick(name.c_str(), Limits.NickMax))
                        throw CoreException("<type:name> is invalid (value '" + name + "')");
+               if (oper_blocks.find(" " + name) != oper_blocks.end())
+                       throw CoreException("Duplicate type block with name " + name + " at " + tag->getTagLocation());
 
                OperInfo* ifo = new OperInfo;
                oper_blocks[" " + name] = ifo;