From 6b5767fdd2f372ef5648f438dc68942f39658698 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 Dec 2005 20:03:28 +0000 Subject: Fixed spanningtree to not allow malformed conf tags (missing/empty values) Added m_spanningtree, m_swhois and some clarifications to example conf git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2563 e03df62e-2008-0410-955e-edbf42e46eb7 --- conf/inspircd.conf.example | 57 +++++++++++++++++++++++++++++------------- src/modules/m_spanningtree.cpp | 12 +++++++-- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/conf/inspircd.conf.example b/conf/inspircd.conf.example index ac48be1ee..95174d2ca 100644 --- a/conf/inspircd.conf.example +++ b/conf/inspircd.conf.example @@ -11,9 +11,10 @@ # This is an example of the config file for InspIRCd. # # Change the options to suit your network # # # -# Last updated on : 06/06/2005 # +# Last updated on : 18/12/2005 # # Written by : CC (cc@backchat.co.za) # # Updated by : katsklaw (katsklaw@gmail.com) # +# Updated by: : brain (brain@inspircd.org) # ######################################################################## @@ -59,24 +60,17 @@ # a standard tcp based socket, the servers type is a # # also a TCP based connection but of a different # # format. # -# default - if the port type is 'servers' then this can be # -# specified. If set to 'yes', it indicates that this # -# port is the default route for all /connect commands.# -# if you do not bind your default route to an # -# external ip, or all ip's, you may have connection # -# problems. # -# # +# # # Leaving address empty binds to all available interfaces # # # # Syntax is as follows: # # # # # # # -# # # # - + @@ -163,7 +157,7 @@ # # - + @@ -173,6 +167,10 @@ # Classes are a group of commands which are grouped together # # and given a unique name. They used to define which commands # # are available to certain types of Operators. # +# # +# Note that you are not restricted just to the class names shown # +# here and you can make your own up. That is the idea, this ircd # +# is very unrestrictive about configuration. # # # # Syntax is as follow: # # # @@ -196,11 +194,16 @@ # server admin to decide on which operators get # # what commands # # host - hostmask operators will recieve on oper-up. # -#(optional) # +# (optional) # # # # Syntax is as follows: # # # # # +# Please note that you are not restricted to just the four oper types # +# shown below. You can make up your own opertypes, that is what its # +# designed for! Please note that oper types, and classes above, are # +# case sensitive and may only be one word long, no spaces. # +# # @@ -244,7 +247,7 @@ # not have to resolve - but it is expected to be sent # # in the remote servers connection info. # # ipaddr - Valid host or ip address for remote server. * # -# port - Valid listening UDP port for remote server. # +# port - Valid listening TCP port for remote server. # # sendpass - Password to send to create an outbound connection to # # this server. # # recvpass - Password to receive to accept an inbound connection # @@ -308,7 +311,11 @@ # shell using shell scripts, perl scripts etc, and to monitor the # # ircd's state via cron jobs. # # # +# This tag is NOT optional and must be defined. Once you have defined # +# it, remove the die tag above it to mark it as valid. # +# # + #-#-#-#-#-#-#-#-#-#-#-#-#- BANLIST LIMITS #-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -390,12 +397,9 @@ netbuffersize="10240" maxwho="128" noservices="0" - somaxconn="128" - softlimit="128" allowhalfop="yes"> - #-#-#-#-#-#-#-#-#-#-#-#-#- MODULE OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-# # # # These tags define which modules will be loaded on startup by your # @@ -415,8 +419,23 @@ # are incorporated into the executable and can be loaded and removed # # similarly to if they were in a ramdisk. # + +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# ____ _____ _ ____ _____ _ _ ___ ____ ____ ___ _____ _ +# | _ \| ____| / \ | _ \ |_ _| | | |_ _/ ___| | __ )_ _|_ _| | +# | |_) | _| / _ \ | | | | | | | |_| || |\___ \ | _ \| | | | | | +# | _ <| |___ / ___ \| |_| | | | | _ || | ___) | | |_) | | | | |_| +# |_| \_\_____/_/ \_\____/ |_| |_| |_|___|____/ |____/___| |_| (_) +# +# Please note that as of 1.0 Beta 6 and onwards, linking is modular. +# This means that unless you load m_spanningtree.so (as commented out +# below) you will be UNABLE TO LINK ANY SERVERS (including services!). +# Uncommenting the tag below loads basic linking support. +# +# + #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Foobar module - does nothing +# Foobar module - does nothing. This is a test module for coders. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -634,6 +653,10 @@ # Oper modes module: Allows you to specify modes to add/remove on oper # +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# SWHOIS module. Allows opers to place arbitary text in their WHOIS. +# + #-#-#-#-#-#-#-#-#-#-#- FILTER CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 334310b8c..0f10b2de0 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -2139,8 +2139,16 @@ void ReadConfiguration(bool rebind) L.RecvPass = Conf->ReadValue("link","recvpass",j); L.AutoConnect = Conf->ReadInteger("link","autoconnect",j,true); L.NextConnectTime = time(NULL) + L.AutoConnect; - LinkBlocks.push_back(L); - log(DEBUG,"m_spanningtree: Read server %s with host %s:%d",L.Name.c_str(),L.IPAddr.c_str(),L.Port); + /* Bugfix by brain, do not allow people to enter bad configurations */ + if ((recvpass != "") && (sendpass != "") && (Name != "") && (Port)) + { + LinkBlocks.push_back(L); + log(DEBUG,"m_spanningtree: Read server %s with host %s:%d",L.Name.c_str(),L.IPAddr.c_str(),L.Port); + } + else + { + log(DEFAULT,"m_spanningtree: Invalid configuration for server '%s', ignored!",L.Name.c_str()); + } } delete Conf; } -- cgit v1.2.3