diff -c -r irc2.8.21.old/common/parse.c irc2.8.21/common/parse.c *** irc2.8.21.old/common/parse.c Sun Aug 20 01:42:20 1995 --- irc2.8.21/common/parse.c Sun Aug 20 15:44:56 1995 *************** *** 500,507 **** */ if (IsServer(sptr) || IsMe(sptr)) { ! sendto_ops("Dropping server %s", cptr->name); return exit_client(cptr, cptr, &me, "Fake Direction"); } /* * Ok, someone is trying to impose as a client and things are --- 500,510 ---- */ if (IsServer(sptr) || IsMe(sptr)) { ! sendto_ops("Not dropping server %s for Fake Direction", cptr->name); ! return -1; ! /* return exit_client(cptr, cptr, &me, "Fake Direction"); + */ } /* * Ok, someone is trying to impose as a client and things are diff -c -r irc2.8.21.old/common/send.c irc2.8.21/common/send.c *** irc2.8.21.old/common/send.c Sun Aug 20 01:42:20 1995 --- irc2.8.21/common/send.c Sun Aug 20 16:11:43 1995 *************** *** 32,37 **** --- 32,38 ---- #include "sys.h" #include "h.h" #include + #include "numeric.h" #ifdef IRCII_KLUDGE #define NEWLINE "\n" *************** *** 861,866 **** --- 862,895 ---- #else par = p1; #endif + /* This if() checks to make sure we don't send the same + message back to the place we received it from. This + occurs when a client becomes ghosted and 2 servers + have different information about the client. + -- Taner & Comstud + */ + if (from && to && !MyClient(from) && + IsPerson(to) && (to->from == from->from)) + { + if (IsServer(from)) + { + sendto_ops("Send message to %s[%s] would have caused Fake Direction", + to->name, to->from->name); + return; + } + sendto_ops("Send message failed to ghosted %s[%s] from %s[%s]", + to->name, to->from->name, from->name, + from->from->name); + sendto_serv_butone(NULL, ":%s KILL %s :%s (%s[%s@%s] Ghosted)", + me.name, to->name, me.name, to->name, + to->user->username, to->user->host); + to->flags |= FLAGS_KILLED; + (void)exit_client(NULL, to, &me, "Ghost"); + if (IsPerson(from)) + sendto_one(from, err_str(ERR_GHOSTEDCLIENT), + me.name, to->name); + return; + } if (to && from && MyClient(to) && IsPerson(from) && !mycmp(par, from->name)) { diff -c -r irc2.8.21.old/include/numeric.h irc2.8.21/include/numeric.h *** irc2.8.21.old/include/numeric.h Sun Aug 20 01:42:19 1995 --- irc2.8.21/include/numeric.h Sun Aug 20 14:58:28 1995 *************** *** 189,194 **** --- 189,196 ---- #define ERR_UMODEUNKNOWNFLAG 501 #define ERR_USERSDONTMATCH 502 + #define ERR_GHOSTEDCLIENT 503 + /* * Numberic replies from server commands. * These are currently in the range 200-399. diff -c -r irc2.8.21.old/ircd/s_err.c irc2.8.21/ircd/s_err.c *** irc2.8.21.old/ircd/s_err.c Sun Aug 20 01:42:20 1995 --- irc2.8.21/ircd/s_err.c Sun Aug 20 14:56:58 1995 *************** *** 125,130 **** --- 125,131 ---- 0, (char *)NULL, 0, (char *)NULL, /* 501 */ ERR_UMODEUNKNOWNFLAG, ":Unknown MODE flag", /* 502 */ ERR_USERSDONTMATCH, ":Cant change mode for other users", + /* 503 */ ERR_GHOSTEDCLIENT, "%s :Message could not be delivered to %s", 0, (char *)NULL };