Author: Bleep <twhelvey1@home.com>
authorBleep <twhelvey1@home.com>
Thu, 8 Feb 2001 04:20:08 +0000 (04:20 +0000)
committerBleep <twhelvey1@home.com>
Thu, 8 Feb 2001 04:20:08 +0000 (04:20 +0000)
Log message: Fix for protocol violation spam bug. See the ChangeLog for
rant. :)

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

ChangeLog
ircd/ircd_reply.c

index 6302d7d6ec5fc5472feeea438a0c4fdc5fb0841a..76d6d35b372b85884fc069455b8bac6d6d2360d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2001-01-29  Thomas Helvey <twhelvey1@home.com>
+
+       * ircd/ircd_reply.c (need_more_params): fix bug that allowed
+       unregistered clients to spam opers with protocol violation
+       messages. Note: the bugfix may have eliminated some useful
+       protocol violation messages.
+       Please send protocol violation messages explicitly from the
+       functions they are discovered in, you have much better context
+       for the error there and it helps to document the behavior of the
+       server. This was also a design bug in that it violated the
+       "A function should do one thing" heuristic. Patching this one
+       would have resulted in a continuous spawning of other bugs over
+       the next 3 years, so I killed it. Check around for stuff this
+       broke and readd the calls to protocol_violation in the functions
+       that need to send the message.
+
 2001-01-29  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/channel.c (mode_parse_ban): stopper a tiny leak--if a ban
index c8df3c4cacd25c826e1c88fb9eee4b8d9ace95bd..3a222a3f8cf2e7fcd4e9b25c8192c5a7339fb445 100644 (file)
@@ -59,8 +59,16 @@ int protocol_violation(struct Client* cptr, const char* pattern, ...)
 
 int need_more_params(struct Client* cptr, const char* cmd)
 {
+#if 0
+  /*
+   * XXX - bug
+   * shouldn't try to do more than one thing at a time,
+   * call protocol_violation explicitly where it's needed and
+   * context is available.
+   */
   if (!MyUser(cptr))
-    protocol_violation(cptr,"Not enough parameters for %s",cmd);
+    protocol_violation(cptr, "Not enough parameters for %s",cmd);
+#endif
   send_reply(cptr, ERR_NEEDMOREPARAMS, cmd);
   return 0;
 }