Author: Ghostwolf <foxxe@wtfs.net>
authorJoseph Bongaarts <foxxe@wtfs.net>
Mon, 11 Mar 2002 06:36:52 +0000 (06:36 +0000)
committerJoseph Bongaarts <foxxe@wtfs.net>
Mon, 11 Mar 2002 06:36:52 +0000 (06:36 +0000)
Log message:
Last of the bug fixes for do_kill()

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

ChangeLog
ircd/m_kill.c

index e5bc07c2a5873e11b410e746c0dffc18744cc0ee..d950668f17396d73810eb7cd5ea1b1bcb5cdd2c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2002-03-10 Joseph Bongaarts <foxxe@wtfs.net>
 
+       * ircd/m_kill.c: Last of the bug fixes for do_kill()
+
        * ircd/list.c: Don't remove clients from the linked list
        that aren't actually in the list.
        
index 34e1a5ab0eb048b20f399fae37b0e21987862b63..978119e169fed705f38510323b7d21c2d35bb863 100644 (file)
  *
  */
 static int do_kill(struct Client* cptr, struct Client* sptr,
-                  struct Client* victim, char* path)
+                  struct Client* victim, char* inpath, char* path)
 {
-  const char*  inpath;
   char*        comment;
   char         buf[BUFSIZE];
 
@@ -114,7 +113,8 @@ static int do_kill(struct Client* cptr, struct Client* sptr,
   assert(0 != sptr);
   assert(IsUser(victim));
 
-  if (IsServer(sptr)) {
+  if (!MyConnect || IsServer(sptr)) 
+  {
      if (!(comment = strchr(path, ' ')))
        comment = "No reason supplied";
      else
@@ -139,11 +139,9 @@ static int do_kill(struct Client* cptr, struct Client* sptr,
    * Note: "victim->name" is used instead of "user" because we may
    *       have changed the target because of the nickname change.
    */
-  inpath = IsServer(sptr) ? cli_name(cptr) : cli_user(sptr)->host;
-
   sendto_opmask_butone(0, IsServer(sptr) ? SNO_SERVKILL : SNO_OPERKILL,
                        "Received KILL message for %s. From %s Path: %s!%s",
-                       get_client_name(victim, SHOW_IP), cli_name(cptr),
+                       get_client_name(victim, SHOW_IP), cli_name(sptr),
                        inpath, comment);
   log_write_kill(victim, sptr, inpath, path);
 
@@ -245,7 +243,7 @@ int ms_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (Ghost 5 Numeric Collided)",
                   victim, path);
   }
-  return do_kill(cptr, sptr, victim, path);
+  return do_kill(cptr, sptr, victim, cli_name(cptr), path);
 }
 
 /*
@@ -311,5 +309,5 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
                  sptr, cli_name(victim));
     return 0;
   }
-  return do_kill(cptr, sptr, victim, path);
+  return do_kill(cptr, sptr, victim, cli_user(sptr)->host, path);
 }