Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Sat, 28 Jul 2001 16:57:34 +0000 (16:57 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Sat, 28 Jul 2001 16:57:34 +0000 (16:57 +0000)
Log message:

Forward-port of last minute changes in u2.10.10.pl15; merge ChangeLog.10
from that branch.

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

ChangeLog
ChangeLog.10
include/s_user.h
include/supported.h
ircd/m_kill.c
ircd/m_nick.c
ircd/m_version.c
ircd/s_misc.c
ircd/s_user.c

index 651c1715d572016584ae82cb38baeceda28da072..725ebac7e3ba1ffc87fbfcec2dbf2cb8bfa1db39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2001-07-28  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * ircd/s_user.c: implement send_supported() to send two ISUPPORT
+       messages containing our feature buffers; make register_user() use
+       send_supported()
+
+       * ircd/s_misc.c (exit_client): make sure not to give away a remote
+       server in the ERROR message sent to the client; if the killer is a
+       server, we substitute our name in its place
+
+       * ircd/m_version.c (m_version): use send_supported() to send the
+       ISUPPORT values to the user
+
+       * ircd/m_nick.c: shave nick collision kills here a bit, too, for
+       the same reasons as for m_kill.c
+
+       * ircd/m_kill.c: shave kills a bit so that the results look
+       exactly the same no matter where you are; if we didn't do this, it
+       would be possible to map the network by looking at the differences
+       between kills originating under various circumstances
+
+       * include/supported.h: split the features into two, so as to not
+       bust the parameter count when sending the features list
+
+       * include/s_user.h: declare new send_supported() function to send
+       the ISUPPORT information
+
 2001-07-27  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/s_bsd.c: disable IP (*not* TCP) options to prevent
index a968a8139bacae5ebfd680b088def66251729391..6841b04032f0f4dd83bfe9bc284c291254030e11 100644 (file)
@@ -1,10 +1,21 @@
 #
 # ChangeLog for ircu2.10.10
 #
-# $Id: ChangeLog.10,v 1.9 2001-06-29 16:15:56 kev Exp $
+# $Id: ChangeLog.10,v 1.10 2001-07-28 16:57:33 kev Exp $
 #
 # Insert new changes at beginning of the change list.
 #
+-------------------------- Released 2.10.10.pl15
+* Fiddle with /KILL and various exits to make the user experience uniform,
+  no matter who's doing the killing or where.  Previously, differences in
+  QUITs and in the messages sent to the killed client could help make a
+  partial map of the network; now that these messages are all uniform, there
+  is no way to tell. -Kev
+* Split ISUPPORT numeric into two numerics, so as not to exceed the 15
+  parameter limit imposed by the RFC -Kev
+* Turn on HEAD_IN_SAND_REMOTE...oops -Kev
+* Send prefixed error messages to other servers, so ERROR doesn't get
+  interpreted as a prefix -Kev
 * Reverse sense of HEAD_IN_SAND_WHO_HOPCOUNT to do what was intended; use a
   hopcount of 0 if user is using /who on him/herself -Kev
 * Allow a user to see his/her own idle time without having to do
@@ -45,6 +56,7 @@
 * Fixed /who showing server name -- Isomer
 * Fixed burst showing linking server -- Isomer
 * Fixed burst bans showing linked server -- Isomer
+* Fixed /whowas showing server name -- Isomer
 -------------------------- Released 2.10.10.pl14 (You got any issues with that punk?)
 * Changed (then fixed) /LINKS to output an empty links list -- Isomer
 * Make netsplit server notice say the right thing
index 7de772aca951f372be0bcdcc8869c69a0027335c..542cc55d314f831aec34975f6397a1322ceed22e 100644 (file)
@@ -96,6 +96,7 @@ extern int check_target_limit(struct Client *sptr, void *target, const char *nam
 extern void add_target(struct Client *sptr, void *target);
 extern unsigned int umode_make_snomask(unsigned int oldmask, char *arg,
                                        int what);
+extern int send_supported(struct Client *cptr);
 
 #define NAMES_ALL 1 /* List all users in channel */
 #define NAMES_VIS 2 /* List only visible users in non-secret channels */
index c97d12689878f032bab470d29850e1371e211a4f..72f760259c4797d1d7848d5bd5e0d07d55131acf 100644 (file)
@@ -31,7 +31,7 @@
 /* 
  * 'Features' supported by this ircd
  */
-#define FEATURES \
+#define FEATURES1 \
                 "WHOX"\
                 " WALLCHOPS"\
                 " USERIP"\
                 " NICKLEN=%i" \
                 " TOPICLEN=%i" \
                 " KICKLEN=%i" \
-                " CHANTYPES=%s" \
-                " PREFIX=%s" \
+                " CHANTYPES=%s"
+
+#define FEATURES2 "PREFIX=%s" \
                 " CHANMODES=%s" \
                 " CHARSET=%s"
 
-#define FEATURESVALUES feature_int(FEAT_MAXSILES), MAXMODEPARAMS, \
-                      feature_int(FEAT_MAXCHANNELSPERUSER), \
-                      feature_int(FEAT_MAXBANS), NICKLEN, TOPICLEN, \
-                      TOPICLEN, "+#&", "(ov)@+", "b,k,l,imnpst", "rfc1459"
+#define FEATURESVALUES1 feature_int(FEAT_MAXSILES), MAXMODEPARAMS, \
+                       feature_int(FEAT_MAXCHANNELSPERUSER), \
+                       feature_int(FEAT_MAXBANS), NICKLEN, TOPICLEN, \
+                       TOPICLEN, "+#&"
+
+#define FEATURESVALUES2 "(ov)@+", "b,k,l,imnpst", "rfc1459"
 
 #endif /* INCLUDED_supported_h */
 
index 10ace4aa10114633f7611add1767525991d7fb87..8df31efaee50776b40f4b0979b9e0b380483dab4 100644 (file)
@@ -113,7 +113,7 @@ int ms_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   const char*    inpath;
   char*          user;
   char*          path;
-  char*          killer;
+  char*          comment;
   char           buf[BUFSIZE];
 
   assert(0 != cptr);
@@ -187,6 +187,13 @@ int ms_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   cli_flags(victim) |= FLAGS_KILLED;
 
+  /*
+   * the first space in path will be at the end of the
+   * opers name:
+   * bla.bla.bla!host.net.dom!opername (comment)
+   */
+  if (!(comment = strchr(path, ' ')))
+    comment = " (No reason given)";
   /*
    * Tell the victim she/he has been zapped, but *only* if
    * the victim is on current server--no sense in sending the
@@ -194,22 +201,12 @@ int ms_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * anyway (as this user don't exist there any more either)
    */
   if (MyConnect(victim))
-    sendcmdto_one(sptr, CMD_KILL, victim, "%C :%s!%s", victim, NumServ(cptr),
-                 path);
-  /*
-   * the first space in path will be at the end of the
-   * opers name:
-   * bla.bla.bla!host.net.dom!opername (comment)
-   */
-  if ((killer = strchr(path, ' '))) {
-    while (killer > path && '!' != *killer)
-      --killer;
-    if ('!' == *killer)
-      ++killer;
-  }
-  else
-    killer = path;
-  ircd_snprintf(0, buf, sizeof(buf), "Killed (%s)", killer);
+    sendcmdto_one(IsServer(sptr) ? &me : sptr, CMD_KILL, victim,
+                 "%C :%s!%s", victim, IsServer(sptr) ? "*.undernet.org" :
+                 cli_name(sptr), comment);
+
+  ircd_snprintf(0, buf, sizeof(buf), "Killed (%s%s)", IsServer(sptr) ?
+               "*.undernet.org" : cli_name(sptr), comment);
 
   return exit_client(cptr, victim, sptr, buf);
 }
@@ -292,8 +289,7 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   inpath = cli_user(sptr)->host;
 
-  ircd_snprintf(0, buf, sizeof(buf), "%s%s (%s)", cli_name(cptr),
-               IsOper(sptr) ? "" : "(L)", comment);
+  ircd_snprintf(0, buf, sizeof(buf), "%s (%s)", cli_name(cptr), comment);
   path = buf;
 
   /*
@@ -326,8 +322,6 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     */
     cli_flags(victim) |= FLAGS_KILLED;
 
-    ircd_snprintf(0, buf, sizeof(buf), "Killed by %s (%s)", cli_name(sptr),
-                 comment);
   }
   else {
   /*
@@ -336,10 +330,11 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * notification chasing the above kill, it won't get far
    * anyway (as this user don't exist there any more either)
    */
-    sendcmdto_one(sptr, CMD_KILL, victim, "%C :%s!%s", victim, inpath, path);
-    ircd_snprintf(0, buf, sizeof(buf), "Local kill by %s (%s)",
-                 cli_name(sptr), comment);
+    sendcmdto_one(sptr, CMD_KILL, victim, "%C :%s", victim, path);
   }
 
+  ircd_snprintf(0, buf, sizeof(buf), "Killed (%s (%s))", cli_name(sptr),
+               comment);
+
   return exit_client(cptr, victim, sptr, buf);
 }
index 76b29ff89b9ad2eb475411e8473caaa22118dad6..4307160c4a1f63cbe1b9767afb8cf097b04d7f07 100644 (file)
@@ -318,7 +318,7 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   assert(0 != acptr);
 
-  if (IsServer(acptr)) {
+  if (IsServer(acptr)) { /* shouldn't even happen, actually */
     /*
      * We have a nickname trying to use the same name as
      * a server. Send out a nick collision KILL to remove
@@ -337,7 +337,9 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /*
      * if sptr is a server it is exited here, nothing else to do
      */
-    return exit_client(cptr, sptr, &me, "Nick/Server collision");
+    return exit_client_msg(cptr, sptr, &me,
+                          "Killed (*.undernet.org (%s <- %s))",
+                          cli_name(cli_from(acptr)), cli_name(cptr));
   }
 
   /*
@@ -443,7 +445,8 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         assert(!MyConnect(sptr));
 
         cli_flags(sptr) |= FLAGS_KILLED;
-        exit_client(cptr, sptr, &me, "Nick collision (you're a ghost)");
+        exit_client(cptr, sptr, &me,
+                   "Killed (*.undernet.org (Nick collision))");
         /*
          * we have killed sptr off, zero out it's pointer so if it's used
          * again we'll know about it --Bleep
@@ -464,18 +467,26 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (differ) {
     sendcmdto_serv_butone(&me, CMD_KILL, acptr, "%C :%s (older nick "
                          "overruled)", acptr, cli_name(&me));
-    if (MyConnect(acptr))
-      sendcmdto_one(acptr, CMD_QUIT, cptr, ":Local kill by %s (Ghost)",
-                   cli_name(&me));
-    exit_client(cptr, acptr, &me, "Nick collision (older nick overruled)");
+    if (MyConnect(acptr)) {
+      sendcmdto_one(acptr, CMD_QUIT, cptr, ":Killed (*.undernet.org (older "
+                   "nick overruled))");
+      sendcmdto_one(&me, CMD_KILL, acptr, "%C :*.undernet.org (older nick "
+                   "overruled)", acptr);
+    }
+    exit_client(cptr, acptr, &me, "Killed (*.undernet.org (older nick "
+               "overruled))");
   }
   else {
     sendcmdto_serv_butone(&me, CMD_KILL, acptr, "%C :%s (nick collision from "
                          "same user@host)", acptr, cli_name(&me));
-    if (MyConnect(acptr))
-      sendcmdto_one(acptr, CMD_QUIT, cptr, ":Local kill by %s (Ghost: ",
-                   "switched servers too fast)", cli_name(&me));
-    exit_client(cptr, acptr, &me, "Nick collision (You collided yourself)");
+    if (MyConnect(acptr)) {
+      sendcmdto_one(acptr, CMD_QUIT, cptr, ":Killed (*.undernet.org (nick "
+                   "collision from same user@host))");
+      sendcmdto_one(&me, CMD_KILL, acptr, "%C :*.undernet.org (older nick "
+                   "overruled)", acptr);
+    }
+    exit_client(cptr, acptr, &me, "Killed (*.undernet.org (nick collision "
+               "from same user@host))");
   }
   if (lastnick == cli_lastnick(acptr))
     return 0;
index 082deefcfaa1160920fe78fec36148dc70996b05..105b0f73bb1636dc221eec3d445fb0bd59716ec6 100644 (file)
@@ -123,13 +123,9 @@ int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (hunt_server_cmd(sptr, CMD_VERSION, cptr, HEAD_IN_SAND_REMOTE, ":%C", 1,
                      parc, parv) == HUNTED_ISME)
   {
-    char featurebuf[512];
-    
-    ircd_snprintf(0, featurebuf, sizeof(featurebuf), FEATURES, FEATURESVALUES);
-    
     send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
               debug_serveropts());
-    send_reply(sptr, RPL_ISUPPORT, featurebuf);
+    send_supported(sptr);
   }
 
   return 0;
index b4d9af7013dd85294f46eb911b0d5c36a3cd3f3e..1b1dcad7343b8dd4be0c20511e20c9a56346f0b5 100644 (file)
@@ -410,7 +410,8 @@ int exit_client(struct Client *cptr,    /* Connection being handled by
                          cli_name(killer), comment);
          else
            sendrawto_one(victim, MSG_ERROR " :Closing Link: %s by %s (%s)",
-                         cli_name(victim), cli_name(killer), comment);
+                         cli_name(victim), IsServer(killer) ? cli_name(&me) :
+                         cli_name(killer), comment);
        }
       }
       if ((IsServer(victim) || IsHandshake(victim) || IsConnecting(victim)) &&
index b0ecdf76f63abc8cdbb8b1ca77296afe4744a6c6..96391a3f9a05e3fe7e34d0b35bcc6133e5ec554f 100644 (file)
@@ -383,7 +383,6 @@ int register_user(struct Client *cptr, struct Client *sptr,
   short            digitgroups = 0;
   struct User*     user = cli_user(sptr);
   char             ip_base64[8];
-  char             featurebuf[512];
 
   user->last = CurrentTime;
   parv[0] = cli_name(sptr);
@@ -567,8 +566,7 @@ int register_user(struct Client *cptr, struct Client *sptr,
     send_reply(sptr, RPL_YOURHOST, cli_name(&me), version);
     send_reply(sptr, RPL_CREATED, creation);
     send_reply(sptr, RPL_MYINFO, cli_name(&me), version);
-    ircd_snprintf(0, featurebuf, sizeof(featurebuf), FEATURES, FEATURESVALUES);
-    send_reply(sptr, RPL_ISUPPORT, featurebuf);
+    send_supported(sptr);
     m_lusers(sptr, sptr, 1, parv);
     update_load();
     motd_signon(sptr);
@@ -1541,3 +1539,15 @@ int add_silence(struct Client* sptr, const char* mask)
   return 0;
 }
 
+int
+send_supported(struct Client *cptr)
+{
+  char featurebuf[512];
+
+  ircd_snprintf(0, featurebuf, sizeof(featurebuf), FEATURES1, FEATURESVALUES1);
+  send_reply(sptr, RPL_ISUPPORT, featurebuf);
+  ircd_snprintf(0, featurebuf, sizeof(featurebuf), FEATURES2, FEATURESVALUES2);
+  send_reply(sptr, RPL_ISUPPORT, featurebuf);
+
+  return 0; /* convenience return, if it's ever needed */
+}