From 38e7be8ec06f41e1de3745a87b0da6bbdd0f3f93 Mon Sep 17 00:00:00 2001 From: Bleep Date: Thu, 8 Feb 2001 04:20:08 +0000 Subject: [PATCH] Author: Bleep 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 | 16 ++++++++++++++++ ircd/ircd_reply.c | 10 +++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6302d7d..76d6d35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2001-01-29 Thomas Helvey + + * 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 * ircd/channel.c (mode_parse_ban): stopper a tiny leak--if a ban diff --git a/ircd/ircd_reply.c b/ircd/ircd_reply.c index c8df3c4..3a222a3 100644 --- a/ircd/ircd_reply.c +++ b/ircd/ircd_reply.c @@ -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; } -- 2.20.1