From: Kevin L. Mitchell Date: Sat, 28 Jul 2001 16:57:34 +0000 (+0000) Subject: Author: Kev X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=b5253a88953deac93d3e9c469cb9b4e3b8c7fd8e Author: Kev 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 --- diff --git a/ChangeLog b/ChangeLog index 651c171..725ebac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2001-07-28 Kevin L. Mitchell + + * 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 * ircd/s_bsd.c: disable IP (*not* TCP) options to prevent diff --git a/ChangeLog.10 b/ChangeLog.10 index a968a81..6841b04 100644 --- a/ChangeLog.10 +++ b/ChangeLog.10 @@ -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 diff --git a/include/s_user.h b/include/s_user.h index 7de772a..542cc55 100644 --- a/include/s_user.h +++ b/include/s_user.h @@ -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 */ diff --git a/include/supported.h b/include/supported.h index c97d126..72f7602 100644 --- a/include/supported.h +++ b/include/supported.h @@ -31,7 +31,7 @@ /* * 'Features' supported by this ircd */ -#define FEATURES \ +#define FEATURES1 \ "WHOX"\ " WALLCHOPS"\ " USERIP"\ @@ -44,15 +44,18 @@ " 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 */ diff --git a/ircd/m_kill.c b/ircd/m_kill.c index 10ace4a..8df31ef 100644 --- a/ircd/m_kill.c +++ b/ircd/m_kill.c @@ -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); } diff --git a/ircd/m_nick.c b/ircd/m_nick.c index 76b29ff..4307160 100644 --- a/ircd/m_nick.c +++ b/ircd/m_nick.c @@ -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; diff --git a/ircd/m_version.c b/ircd/m_version.c index 082deef..105b0f7 100644 --- a/ircd/m_version.c +++ b/ircd/m_version.c @@ -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; diff --git a/ircd/s_misc.c b/ircd/s_misc.c index b4d9af7..1b1dcad 100644 --- a/ircd/s_misc.c +++ b/ircd/s_misc.c @@ -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)) && diff --git a/ircd/s_user.c b/ircd/s_user.c index b0ecdf7..96391a3 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -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 */ +}