]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Merge branch 'insp20' into master.
authorPeter Powell <petpow@saberuk.com>
Mon, 11 Dec 2017 11:41:44 +0000 (11:41 +0000)
committerPeter Powell <petpow@saberuk.com>
Mon, 11 Dec 2017 11:41:44 +0000 (11:41 +0000)
1  2 
docs/conf/modules.conf.example
src/channels.cpp
src/modules/m_banexception.cpp

index 7c5b0b6e8112df6bc1c0bdb4909ac7af268996d7,7fb68995a11ea960e1875b272937407fe7adf329..95b742eb126e22b782b1a877cf05447f439355d3
  #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  # SQL authentication module: Allows IRCd connections to be tied into
  # a database table (for example a forum).
- # This module is in extras. Re-run configure with:
- # ./configure --enable-extras=m_sqlauth.cpp
- # and run make install, then uncomment this module to enable it.
  #
 -#<module name="m_sqlauth.so">
 +#<module name="sqlauth">
  #
  #-#-#-#-#-#-#-#-#-#-#- SQLAUTH CONFIGURATION   -#-#-#-#-#-#-#-#-#-#-#-#
  #                                                                     #
  
  #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  # SQL oper module: Allows you to store oper credentials in an SQL table
- # This module is in extras. Re-run configure with:
- # ./configure --enable-extras=m_sqloper.cpp
- # and run make install, then uncomment this module to enable it.
  #
 -#<module name="m_sqloper.so">
 +#<module name="sqloper">
  #
  #-#-#-#-#-#-#-#-#-#-#- SQLOPER CONFIGURATION   -#-#-#-#-#-#-#-#-#-#-#-#
  #                                                                     #
index 3bc58505c83f1edd0d979407637cacd0bbacc090,df2212a219b9f94ae9864477939fd926d96904b9..7e6555ae80b94d666f22ae46aa60a1d10ae816df
@@@ -398,20 -474,12 +398,20 @@@ ModResult Channel::GetExtBanStatus(Use
        FIRST_MOD_RESULT(OnExtBanCheck, rv, (user, this, type));
        if (rv != MOD_RES_PASSTHRU)
                return rv;
 -      for (BanList::iterator i = this->bans.begin(); i != this->bans.end(); i++)
 +
 +      ListModeBase* banlm = static_cast<ListModeBase*>(*ban);
 +      if (!banlm)
 +              return MOD_RES_PASSTHRU;
 +
 +      const ListModeBase::ModeList* bans = banlm->GetList(this);
 +      if (bans)
        {
 -              if (i->data.length() > 2 && i->data[0] == type && i->data[1] == ':')
 +              for (ListModeBase::ModeList::const_iterator it = bans->begin(); it != bans->end(); ++it)
                {
-                       if (it->mask[0] != type || it->mask[1] != ':')
 -                      std::string val = i->data.substr(2);
 -                      if (CheckBan(user, val))
++                      if (it->mask.length() <= 2 || it->mask[0] != type || it->mask[1] != ':')
 +                              continue;
 +
 +                      if (CheckBan(user, it->mask.substr(2)))
                                return MOD_RES_DENY;
                }
        }
index b29b397475e5e304fb2e79b76e85e3713258a666,7531c5c1250bc3cd6d01845f6c339cd0fd9e5b3d..4bfd19373d26847a7aa98e74e19f2670a6ab17a4
@@@ -51,26 -54,39 +51,26 @@@ class ModuleBanException : public Modul
        {
        }
  
 -      void init()
 +      void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
 -              ServerInstance->Modules->AddService(be);
 -
 -              be.DoImplements(this);
 -              Implementation list[] = { I_OnRehash, I_On005Numeric, I_OnExtBanCheck, I_OnCheckChannelBan };
 -              ServerInstance->Modules->Attach(list, this, sizeof(list)/sizeof(Implementation));
 +              tokens["EXCEPTS"] = "e";
        }
  
 -      void On005Numeric(std::string &output)
 +      ModResult OnExtBanCheck(User *user, Channel *chan, char type) CXX11_OVERRIDE
        {
 -              output.append(" EXCEPTS=e");
 -      }
 +              ListModeBase::ModeList* list = be.GetList(chan);
 +              if (!list)
 +                      return MOD_RES_PASSTHRU;
  
 -      ModResult OnExtBanCheck(User *user, Channel *chan, char type)
 -      {
 -              if (chan != NULL)
 +              for (ListModeBase::ModeList::iterator it = list->begin(); it != list->end(); it++)
                {
-                       if (it->mask[0] != type || it->mask[1] != ':')
 -                      modelist *list = be.extItem.get(chan);
 -
 -                      if (!list)
 -                              return MOD_RES_PASSTHRU;
++                      if (it->mask.length() <= 2 || it->mask[0] != type || it->mask[1] != ':')
 +                              continue;
  
 -                      for (modelist::iterator it = list->begin(); it != list->end(); it++)
 +                      if (chan->CheckBan(user, it->mask.substr(2)))
                        {
 -                              if (it->mask.length() <= 2 || it->mask[0] != type || it->mask[1] != ':')
 -                                      continue;
 -
 -                              if (chan->CheckBan(user, it->mask.substr(2)))
 -                              {
 -                                      // They match an entry on the list, so let them pass this.
 -                                      return MOD_RES_ALLOW;
 -                              }
 +                              // They match an entry on the list, so let them pass this.
 +                              return MOD_RES_ALLOW;
                        }
                }