Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Mon, 20 Nov 2000 21:05:43 +0000 (21:05 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Mon, 20 Nov 2000 21:05:43 +0000 (21:05 +0000)
Log message:

Apply a bandaid to Iso's m_motd change; rewrite protocol_violation so that
it actually works

Testing done: Tested BURST with too few arguments--produced correct
behavior.  Am able to connect to the server as a user without coring
it :)

Status: Stable

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

ChangeLog
ircd/ircd_reply.c
ircd/m_motd.c

index 0af5a67c49213e57d85a26ec210792efbdcb900b..22a6ab6e5ab9961fffcced07cdeae5a2e1bbb5b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2000-11-20  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * ircd/ircd_reply.c (protocol_violation): rewrite
+       protocol_violation so it'll actually work
+
+       * ircd/m_motd.c (m_motd): Iso's addition of get_client_class(sptr)
+       resulted in core dumps if NODEFAULTMOTD is defined, because m_motd
+       gets called from register_user with a NULL sptr.  This is probably
+       a design problem, but this bandaid will do for now...
+
 2000-11-19  Isomer <isomer@coders.net>
        * ircd/ircd_reply.c: added 'protocol_violation', thus alerting us
        to problems in the server<->server protocol.
index 5e33b1bf932d926e1a43c41dafd1c8967256105c..6e8cc6b9d153e2b1b95f9f4443cdb1de169b47ff 100644 (file)
  
 int protocol_violation(struct Client* cptr, const char* pattern, ...)
 {
-       va_list vl;
-       char buffer[512];
-       assert(pattern);
-       assert(cptr);
-       va_start(vl,pattern);
-       ircd_snprintf(0,buffer,sizeof(buffer)-2, 
-               "Protocol Violation from %C: %v",vl);
-       sendcmdto_flag_butone(&me, CMD_DESYNCH, NULL, FLAGS_DEBUG, 
-               ":%s", cptr, buffer);
-       va_end(vl);
-       return 0;
+  struct VarData vd;
+
+  assert(pattern);
+  assert(cptr);
+
+  vd.vd_format = pattern;
+  va_start(vd.vd_args, pattern);
+
+  sendcmdto_flag_butone(&me, CMD_DESYNCH, NULL, FLAGS_DEBUG,
+                       ":Protocol Violation from %C: %v", cptr, &vd);
+
+  va_end(vd.vd_args);
+  return 0;
 }
 
 int need_more_params(struct Client* cptr, const char* cmd)
index 966a8b6556680a3c626c7fca119c8bfae6358702..0eb2034333d5b074408399b7fb920b6d5a95bfd9 100644 (file)
@@ -125,7 +125,7 @@ int m_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   struct TRecord *ptr;
   int count;
   struct MotdItem *temp;
-  int class = get_client_class(sptr);
+  int class = get_client_class(cptr);
 
 #ifdef NODEFAULTMOTD
   int no_motd;