From 1f40bf82203b4f9c4b8f353352e805dcfb8454a8 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sat, 16 Apr 2005 01:53:11 +0000 Subject: [PATCH] Fix bugs spotted in beta testing: Quarantine blocks not working or 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 | 15 +++++++++++++++ doc/example.conf | 12 +++++++++++- ircd/ircd.c | 1 + ircd/ircd_parser.y | 27 +++++++-------------------- ircd/s_stats.c | 3 ++- 5 files changed, 36 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d717f3..2f772af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-04-15 Michael Poole + + * doc/example.conf (Operator): Properly qualify plaintext password. + (Quarantine): Document (new) syntax. + + * ircd/ircd.c: Add to make 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 for UserStats. + (stats_server_verbose): Reinstate check for UserStats. + 2005-04-09 Kevin L. Mitchell * ircd/ircd.c: conditionally include sys/resource.h; otherwise, diff --git a/doc/example.conf b/doc/example.conf index e8e6612..28796d6 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -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 diff --git a/ircd/ircd.c b/ircd/ircd.c index 5703c39..b1c191a 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -69,6 +69,7 @@ #include #include #include +#include #ifdef HAVE_SYS_RESOURCE_H #include #endif diff --git a/ircd/ircd_parser.y b/ircd/ircd_parser.y index fd4fac2..4d0692c 100644 --- a/ircd/ircd_parser.y +++ b/ircd/ircd_parser.y @@ -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 '{' diff --git a/ircd/s_stats.c b/ircd/s_stats.c index 190e8db..3555376 100644 --- a/ircd/s_stats.c +++ b/ircd/s_stats.c @@ -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, -- 2.20.1