Fix bugs spotted in beta testing: Quarantine blocks not working or
authorMichael Poole <mdpoole@troilus.org>
Sat, 16 Apr 2005 01:53:11 +0000 (01:53 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 16 Apr 2005 01:53:11 +0000 (01:53 +0000)
documented, broken compile on BSD, ident-based Deny blocks broken,
/stats v always showed 0 for local clients.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1361 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
doc/example.conf
ircd/ircd.c
ircd/ircd_parser.y
ircd/s_stats.c

index 1d717f3050d7597e72169ee6bd6cf9803a94c225..2f772aff8f7f086481f93678ce6f51be0f1c37d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-04-15  Michael Poole <mdpoole@troilus.org>
+
+       * doc/example.conf (Operator): Properly qualify plaintext password.
+       (Quarantine): Document (new) syntax.
+
+       * ircd/ircd.c: Add <sys/time.h> to make <sys/resource.h> compile
+       correctly on BSDs.
+
+       * ircd/ircd_parser.y (qconf): Remove global variable.
+       (killuhost): Null terminate username when present.
+       (quarantineblock): Replace with a syntax that works.
+
+       * ircd/s_stats.c: #include <querycmds.h> for UserStats.
+       (stats_server_verbose): Reinstate check for UserStats.
+
 2005-04-09  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/ircd.c: conditionally include sys/resource.h; otherwise,
index e8e6612d1c0b69b8f552e97b4df781489e4a2edf..28796d6b0e621c976f200d26a04ecb1e0292c6d3 100644 (file)
@@ -628,7 +628,7 @@ Operator {
 };
 Operator {
  host = "*@*.uu.net";
- password = "notencryptedpass";
+ password = "$PLAIN$notencryptedpass";
  name = "Niels";
  class = "Opers";
 };
@@ -707,6 +707,16 @@ Port {
  port = 7000;
 };
 
+# Quarantine blocks disallow operators from using OPMODE and CLEARMODE
+# on certain channels.  Opers with the force_opmode (for local
+# channels, force_local_opmode) privilege may override the quarantine
+# by prefixing the channel name with an exclamation point ('!').
+# Wildcards are NOT supported; the channel name must match exactly.
+Quarantine {
+  "#shells" = "Thou shalt not support the h4><0rz";
+  "&kiddies" = "They can take care of themselves";
+};
+
 # This is a server-implemented alias to send a message to a service.
 # The string after Pseudo is the command name; the name entry inside
 # is the service name, used for error messages.  More than one nick
index 5703c39905dc16754add18c1cfe2260df242ce0d..b1c191a57639b5d7ad28bf974f007ad6916981b3 100644 (file)
@@ -69,6 +69,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/time.h>
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
index fd4fac2c555637ec4611cc9408802c831b727cb8..4d0692c9dba392cc624eebe8954b678cccc57d61 100644 (file)
@@ -74,7 +74,6 @@
   struct ConnectionClass *c_class;
   struct DenyConf *dconf;
   struct ServerConf *sconf;
-  struct qline *qconf = NULL;
   struct s_map *smap;
   struct Privs privs;
   struct Privs privs_dirty;
@@ -764,7 +763,7 @@ killuhost: HOST '=' QSTRING ';'
   else
   {
     u = $3;
-    h++;
+    *h++ = '\0';
   }
   DupString(dconf->hostmask, h);
   DupString(dconf->usermask, u);
@@ -890,27 +889,15 @@ extrastring: QSTRING
     stringlist[stringno++] = $1;
 };
 
-quarantineblock: QUARANTINE '{'
+quarantineblock: QUARANTINE '{' quarantineitems '}' ';';
+quarantineitems: quarantineitems quarantineitem | quarantineitem;
+quarantineitem: QSTRING '=' QSTRING ';'
 {
-  qconf = (struct qline*) MyCalloc(1, sizeof(*qconf));
-} quarantineitems '}' ';'
-{
-  if (qconf->chname == NULL || qconf->reason == NULL)
-  {
-    parse_error("quarantine blocks need a channel name and a reason.");
-    return 0;
-  }
+  struct qline *qconf = MyCalloc(1, sizeof(*qconf));
+  DupString(qconf->chname, $1);
+  DupString(qconf->reason, $3);
   qconf->next = GlobalQuarantineList;
   GlobalQuarantineList = qconf;
-  qconf = NULL;
-};
-
-quarantineitems: CHANNEL NAME '=' QSTRING ';'
-{
-  DupString(qconf->chname, $4);
-} | REASON '=' QSTRING ';'
-{
-  DupString(qconf->reason, $3);
 };
 
 pseudoblock: PSEUDO QSTRING '{'
index 190e8dbbbf36ced95679ad09f01afcd82a1129cc..355537626a86747736a0b452614908310f6c0828 100644 (file)
@@ -41,6 +41,7 @@
 #include "msgq.h"
 #include "numeric.h"
 #include "numnicks.h"
+#include "querycmds.h"
 #include "res.h"
 #include "s_bsd.h"
 #include "s_conf.h"
@@ -457,7 +458,7 @@ stats_servers_verbose(struct Client* sptr, const struct StatDesc* sd,
                cli_serv(acptr)->asll_rtt,
                cli_serv(acptr)->asll_to,
                cli_serv(acptr)->asll_from,
-               cli_serv(acptr)->clients,
+               (acptr == &me ? UserStats.local_clients : cli_serv(acptr)->clients),
                cli_serv(acptr)->nn_mask,
                cli_serv(acptr)->prot,
                cli_serv(acptr)->timestamp,