]> jfr.im git - irc/UndernetIRC/gnuworld.git/commitdiff
mod.ccontrol: bug fix in LIMITS with unidented clients
authorHidden <redacted>
Tue, 27 Dec 2022 22:18:12 +0000 (17:18 -0500)
committerHidden <redacted>
Tue, 27 Dec 2022 22:18:12 +0000 (17:18 -0500)
* If a client connects and both exceeds the limit and is unidented, two
  glines will be set. Problem fixed is that both glines ended up set
  with the "please install identd" gline message.

mod.ccontrol/ccontrol.cc

index cfc67417b9360e8a463d9884548df47598b7c61c..a18c17d20a05636ee241dcbf8e923f94c8c53ba4 100644 (file)
@@ -2287,11 +2287,11 @@ if(dbConnected)
                }
                bool ipLRetVal = isIpLClientAllowed(NewUser, retList, true);
                for (ipLretStructListType::iterator lItr = retList.begin(); lItr != retList.end(); lItr++) {
-                       bool isUnidentedBan = false;
                        string netblock, nbstring;
                        ipLretStruct rs = *lItr;
                        nb = rs.nb;
                        int ipLconncount = rs.count;
+                       bool isUnidentedBan = rs.type == 'd' ? true : false;
                        bool isUserban = rs.type == 'u' ? true : false;
                        string user = "*";
                        if (isUserban) {
@@ -2299,16 +2299,15 @@ if(dbConnected)
                                assert(st.size() > 0);
                                user = st[0];
                        }
+                       if (isUnidentedBan) {
+                               user = "~*";
+                               ipLRetVal = false;
+                       }
                        ipLRetVal = ipLconncount > rs.limit ? false : true;
                        int tcidr = is_ipv4 ? nb->getCloneCidr() + 96 : nb->getCloneCidr();
                        bool group = false;
                        nbstring = rs.mask;
                        //elog << "ccontrol::handleNewClient> DEBUG: nb->ipLisp->isGlunidented()=" << nb->ipLisp->isGlunidented() << ", NewUser->getUserName().substr(0,1)=" << NewUser->getUserName().substr(0,1) << endl;
-                       if ((nb->ipLisp->isGlunidented()) && (NewUser->getUserName().substr(0,1) == "~")) {
-                               isUnidentedBan = true;
-                               user = "~*";
-                               ipLRetVal = false;
-                       }
                        if (nb->ipLisp->isGroup()) {
                                group = true;
                                netblock = nb->getCidr();