From: wiebe Date: Wed, 21 Jan 2009 17:54:02 +0000 (+0100) Subject: done some work on cansendtochan.patch, added nserverflag.patch, and probably some... X-Git-Url: https://jfr.im/git/irc/quakenet/snircd-patchqueue.git/commitdiff_plain/7efbed3b567d9461de3f2377903002be15a6a007 done some work on cansendtochan.patch, added nserverflag.patch, and probably some more things done that i cant think of atm --- diff --git a/cansendtochan.patch b/cansendtochan.patch index 1640b8c..4b14808 100644 --- a/cansendtochan.patch +++ b/cansendtochan.patch @@ -7,18 +7,23 @@ not tested completely client_can_send_to_channel() and member_can_send_to_channel() -do have some of the exact same code - should maybe add a new function and move those there. -possible problem discovered: +move our cCNT mode checks to new function can_send_to_channel() used +from the two functions above +now the checks for cCNT modes are in one place. +check for +u remains in member_can_send_to_chan() - as quit from non-member does not show + +need to verify handling of remote users, services, servers etc. + +possible problem discovered (ircu): in some places *_can_send_to_channel() is first called with reveal delayedjoin user ON but the code then proceeds to check target limits, which upon refusal means the delayedjoin -user is revealed (locally) without actually sending anything to the channel... that's ugly -must find a way around that - +user is revealed (locally) without actually sending anything to the channel... +...that seems wrong/weird -diff -r f6d476f109e2 include/channel.h ---- a/include/channel.h Mon Jan 19 15:32:18 2009 +0100 -+++ b/include/channel.h Mon Jan 19 22:10:14 2009 +0100 +diff -r 7113a0179d71 include/channel.h +--- a/include/channel.h Wed Jan 21 16:44:50 2009 +0100 ++++ b/include/channel.h Wed Jan 21 17:13:44 2009 +0100 @@ -103,9 +103,9 @@ #define MODE_DELJOINS 0x1000 /**< New join messages are delayed */ #define MODE_REGISTERED 0x2000 /**< Channel marked as registered @@ -54,10 +59,10 @@ diff -r f6d476f109e2 include/channel.h extern void remove_user_from_channel(struct Client *sptr, struct Channel *chptr); extern void remove_user_from_all_channels(struct Client* cptr); -diff -r f6d476f109e2 ircd/channel.c ---- a/ircd/channel.c Mon Jan 19 15:32:18 2009 +0100 -+++ b/ircd/channel.c Mon Jan 19 22:10:14 2009 +0100 -@@ -681,53 +681,102 @@ +diff -r 7113a0179d71 ircd/channel.c +--- a/ircd/channel.c Wed Jan 21 16:44:50 2009 +0100 ++++ b/ircd/channel.c Wed Jan 21 17:13:44 2009 +0100 +@@ -681,10 +681,14 @@ * @param member The membership of the user * @param reveal If true, the user will be "revealed" on a delayed * joined channel. @@ -71,122 +76,64 @@ diff -r f6d476f109e2 ircd/channel.c +int member_can_send_to_channel(struct Membership* member, int reveal, + unsigned int flags, const char *text, const int target) { -+ const char *ch; -+ unsigned int modes; -+ int controlcodes = 0; -+ assert(0 != member); -+ -+ modes = member->channel->mode.mode; - /* Do not check for users on other servers: This should be a +@@ -692,15 +696,17 @@ * temporary desynch, or maybe they are on an older server, but * we do not want to send ERR_CANNOTSENDTOCHAN more than once. */ - if (!MyUser(member->user)) - { -- if (IsDelayedJoin(member) && reveal) -- RevealDelayedJoin(member); -- return 1; -- } -- -- /* +X user can always speak on the channel */ -- if (IsXtraOp(member->user)) { + /* client on service server (+s) - let it through */ + if (IsService(cli_user(member->user)->server)) { if (IsDelayedJoin(member) && reveal) RevealDelayedJoin(member); return 1; } +- +- /* +X user can always speak on the channel */ ++ ++ /* +X exclude +X clients from modes +mMR and bans */ + if (IsXtraOp(member->user)) { ++ if (!can_send_to_channel(member->user, member->channel, flags, text, target)) ++ return 0; + if (IsDelayedJoin(member) && reveal) + RevealDelayedJoin(member); + return 1; +@@ -712,7 +718,7 @@ -- /* Discourage using the Apass to get op. They should use the Upass. */ -+ /* +A Discourage using the Apass to get op. They should use the Upass. */ -+ /* TODO: exclude +X from this? */ - if (IsChannelManager(member) && member->channel->mode.apass[0]) - return 0; - -- /* If you have voice or ops, you can speak. */ -- if (IsVoicedOrOpped(member)) + /* If you have voice or ops, you can speak. */ + if (IsVoicedOrOpped(member)) - return 1; -+ /* If you have voice or ops, you can speak, -+ * else we need do some more checks -+ * but allow umode +X to bypass modes +m +r +M and bans -+ */ -+ if (!IsVoicedOrOpped(member) && !IsXtraOp(member->user)) { - -- /* -- * If it's moderated, and you aren't a privileged user, you can't -- * speak. -- */ -- if (member->channel->mode.mode & MODE_MODERATED) -- return 0; -+ /* -+ * +m If it's moderated, and you aren't a privileged user, you can't -+ * speak. -+ */ -+ if (modes & MODE_MODERATED) -+ return 0; ++ return can_send_to_channel(member->user, member->channel, flags, text, target); -- /* If only logged in users may join and you're not one, you can't speak. */ -- if (member->channel->mode.mode & (MODE_MODERATENOREG|MODE_REGONLY) && !IsAccount(member->user)) -- return 0; -+ /* +r and +M If only logged in users may join and you're not one, you can't speak. */ -+ if (modes & (MODE_MODERATENOREG|MODE_REGONLY) && !IsAccount(member->user)) -+ return 0; + /* + * If it's moderated, and you aren't a privileged user, you can't +@@ -727,6 +733,23 @@ -- /* If you're banned then you can't speak either. */ -- if (is_banned(member)) -- return 0; -+ /* +b If you're banned then you can't speak either. */ -+ if (is_banned(member)) -+ return 0; -+ } -+ -+ /* check these only for local users */ -+ if (MyUser(member->user)) { + /* If you're banned then you can't speak either. */ + if (is_banned(member)) ++ return 0; + -+ /* +T check for multi target message and they are not allowed */ -+ if ((flags & MODE_NOMULTITARGET) && (modes & MODE_NOMULTITARGET) && -+ target > 1) -+ return 0; -+ -+ /* +N check for channel wide notice and they are not allowed */ -+ if ((flags & MODE_NONOTICE) && (modes & MODE_NONOTICE)) -+ return 0; -+ -+ /* +u check for user defined quit and part messages, and they are not allowed */ -+ if ((flags & MODE_NOQUITPARTS) && (modes & MODE_NOQUITPARTS)) -+ return 0; ++ /* enough checked for remote users */ ++ if (!MyUser(member->user)) { ++ if (IsDelayedJoin(member) && reveal) ++ RevealDelayedJoin(member); ++ return 1; ++ } + -+ /* these last two checks should always be last -+ * as they loop over the entire message in search for -+ * CTCP char and control codes -+ */ -+ /* +C check for CTCP and CTCPs are not allowed */ -+ if ((flags & MODE_NOCTCP) && (modes & MODE_NOCTCP) && (text != NULL) && -+ ircd_strncmp(text,"\001ACTION ",8)) { -+ for (ch=text;*ch;) { -+ if (*ch++==1) -+ return 0; -+ if (*ch==2 || *ch==3 || *ch==22 || *ch==27 || *ch==31) -+ controlcodes = 1; -+ } -+ } ++ /* +u check for user defined quit and part messages, ++ * and they are not allowed ++ */ ++ if ((flags & MODE_NOQUITPARTS) && (member->channel->mode.mode & MODE_NOQUITPARTS)) ++ return 0; + -+ /* +c check for control codes and they are not allowed */ -+ if ((flags & MODE_NOCOLOUR) && (modes & MODE_NOCOLOUR) && (text != NULL)) { -+ if (controlcodes) /* already found control codes */ -+ return 0; -+ for (ch=text;*ch;ch++) { -+ if (*ch==2 || *ch==3 || *ch==22 || *ch==27 || *ch==31) -+ return 0; -+ } -+ } -+ } ++ /* check various other modes (like cCNT) */ ++ if (!can_send_to_channel(member->user, member->channel, flags, text, target)) + return 0; if (IsDelayedJoin(member) && reveal) - RevealDelayedJoin(member); -@@ -744,38 +793,95 @@ +@@ -744,16 +767,22 @@ * @param chptr The channel to check * @param reveal If the user should be revealed (see * member_can_send_to_channel()) @@ -205,27 +152,14 @@ diff -r f6d476f109e2 ircd/channel.c { struct Membership *member; - assert(0 != cptr); -+ const char *ch; -+ unsigned int modes; -+ int controlcodes = 0; + + assert(0 != cptr); + /* * Servers can always speak on channels. */ - if (IsServer(cptr)) - return 1; - -+ modes = chptr->mode.mode; - member = find_channel_member(cptr, chptr); - -- /* -+ /* - * You can't speak if you're off channel, and it is +n (no external messages) +@@ -767,15 +796,90 @@ * or +m (moderated). -+ * (moderated also includes +r and +M when you do not have an account set) -+ * exempt clients with umode +X and service clients (clients on +s server) */ if (!member) { - if (IsXtraOp(cptr)) @@ -234,64 +168,94 @@ diff -r f6d476f109e2 ircd/channel.c return 1; - else if ((chptr->mode.mode & (MODE_NOPRIVMSGS|MODE_MODERATED)) || - ((chptr->mode.mode & (MODE_REGONLY|MODE_MODERATENOREG)) && !IsAccount(cptr))) -+ /* client with umode +X exempt from modes +n +m +r +M +b */ ++ /* client with umode +X exempt from modes +nmrM and bans */ + if (!IsXtraOp(cptr)) { -+ if ((modes & (MODE_NOPRIVMSGS|MODE_MODERATED)) || -+ ((modes & (MODE_REGONLY|MODE_MODERATENOREG)) && !IsAccount(cptr))) ++ if ((chptr->mode.mode & (MODE_NOPRIVMSGS|MODE_MODERATED)) || ++ ((chptr->mode.mode & (MODE_REGONLY|MODE_MODERATENOREG)) && !IsAccount(cptr))) + return 0; + if (find_ban(cptr, chptr->banlist)) + return 0; + } -+ -+ /* argh..., now we still have this duplicate code, although closer together -+ * maybe move the checks below into its own function to be used here -+ * from client_can_send_to_channel() and -+ * member_can_send_to_channel() ? -+ */ -+ -+ /* +T check for multi target message and they are not allowed */ -+ if ((flags & MODE_NOMULTITARGET) && (modes & MODE_NOMULTITARGET) && -+ target > 1) ++ /* check various other modes (like cCNT) */ ++ if (!can_send_to_channel(cptr, chptr, flags, text, target)) return 0; - else - return !find_ban(cptr, chptr->banlist); + } +- return member_can_send_to_channel(member, reveal); ++ return member_can_send_to_channel(member, reveal, flags, text, target); ++} + -+ /* +N check for channel wide notice and they are not allowed */ -+ if ((flags & MODE_NONOTICE) && (modes & MODE_NONOTICE)) -+ return 0; ++/** Check if a client can send to a channel. ++ * ++ * These checks are done for both clients on and off the channel. ++ * ++ * @param cptr The client to check ++ * @param chptr The channel to check ++ * @param flags The bitmask of modes to check ++ * @param text The message needed to check for +c and +C ++ * @param target The number of targets the message is sent to, for +T ++ * ++ * @returns true if the client is allowed to speak on the channel, false ++ * otherwise ++ * ++ * @see client_can_send_to_channel() ++ * @see member_can_send_to_channel() ++ */ ++int can_send_to_channel(struct Client *cptr, struct Channel *chptr, ++ unsigned int flags, const char *text, const int target) ++{ ++ const char *ch; ++ unsigned int modes; ++ int controlcodes = 0; ++ ++ assert(0 != cptr); ++ assert(0 != chptr); ++ ++ modes = chptr->mode.mode; ++ ++ /* only check these modes on local users */ ++ if (!MyUser(cptr)) ++ return 1; ++ ++ /* +T check for multi target message and they are not allowed */ ++ if ((flags & MODE_NOMULTITARGET) && (modes & MODE_NOMULTITARGET) && ++ target > 1) ++ return 0; ++ ++ /* +N check for channel wide notice and they are not allowed */ ++ if ((flags & MODE_NONOTICE) && (modes & MODE_NONOTICE)) ++ return 0; + -+ /* these last two checks should always be last -+ * as they loop over the entire message in search for -+ * CTCP char and control codes -+ */ -+ /* +C check for CTCP and CTCPs are not allowed */ -+ if ((flags & MODE_NOCTCP) && (modes & MODE_NOCTCP) && (text != NULL) && -+ ircd_strncmp(text,"\001ACTION ",8)) { -+ for (ch=text;*ch;) { -+ if (*ch++==1) -+ return 0; -+ if (*ch==2 || *ch==3 || *ch==22 || *ch==27 || *ch==31) -+ controlcodes = 1; -+ } ++ /* these last two checks should always be last ++ * as they loop over the entire message in search for ++ * CTCP char and control codes ++ */ ++ /* +C check for CTCP and CTCPs are not allowed */ ++ if ((flags & MODE_NOCTCP) && (modes & MODE_NOCTCP) && (text != NULL) && ++ ircd_strncmp(text,"\001ACTION ",8)) { ++ for (ch=text;*ch;) { ++ if (*ch++==1) ++ return 0; ++ if (*ch==2 || *ch==3 || *ch==22 || *ch==27 || *ch==31) ++ controlcodes = 1; + } ++ } + -+ /* +c check for control codes and they are not allowed */ -+ if ((flags & MODE_NOCOLOUR) && (modes & MODE_NOCOLOUR) && (text != NULL)) { -+ if (controlcodes) /* already found control codes */ ++ /* +c check for control codes and they are not allowed */ ++ if ((flags & MODE_NOCOLOUR) && (modes & MODE_NOCOLOUR) && (text != NULL)) { ++ if (controlcodes) /* already found control codes */ ++ return 0; ++ for (ch=text;*ch;ch++) { ++ if (*ch==2 || *ch==3 || *ch==22 || *ch==27 || *ch==31) + return 0; -+ for (ch=text;*ch;ch++) { -+ if (*ch==2 || *ch==3 || *ch==22 || *ch==27 || *ch==31) -+ return 0; -+ } + } -+ return 1; - } -- return member_can_send_to_channel(member, reveal); -+ return member_can_send_to_channel(member, reveal, flags, text, target); ++ } ++ return 1; } /** Returns the name of a channel that prevents the user from changing nick. -@@ -3625,13 +3731,11 @@ +@@ -3625,13 +3729,11 @@ /* Send notification to channel */ if (!(flags & (CHFL_ZOMBIE | CHFL_DELAYED))) sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_PART, chan, NULL, 0, @@ -307,9 +271,9 @@ diff -r f6d476f109e2 ircd/channel.c ":%H" : "%H :%s", chan, jbuf->jb_comment); /* XXX: Shouldn't we send a PART here anyway? */ /* to users on the channel? Why? From their POV, the user isn't on -diff -r f6d476f109e2 ircd/ircd_relay.c ---- a/ircd/ircd_relay.c Mon Jan 19 15:32:18 2009 +0100 -+++ b/ircd/ircd_relay.c Mon Jan 19 22:10:14 2009 +0100 +diff -r 7113a0179d71 ircd/ircd_relay.c +--- a/ircd/ircd_relay.c Wed Jan 21 16:44:50 2009 +0100 ++++ b/ircd/ircd_relay.c Wed Jan 21 17:13:44 2009 +0100 @@ -87,7 +87,6 @@ void relay_channel_message(struct Client* sptr, const char* name, const char* text, const int targetc) { @@ -329,7 +293,7 @@ diff -r f6d476f109e2 ircd/ircd_relay.c return; } + /* TODO: what is this again? -+ * clinet_can_send_to_channel already reveals delayed join user ++ * client_can_send_to_channel already reveals delayed join user + * locally anyway, and now the message gets denied? + * hmm... + */ @@ -422,9 +386,9 @@ diff -r f6d476f109e2 ircd/ircd_relay.c sendcmdto_channel_butone(sptr, CMD_NOTICE, chptr, cli_from(sptr), SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text); } -diff -r f6d476f109e2 ircd/m_part.c ---- a/ircd/m_part.c Mon Jan 19 15:32:18 2009 +0100 -+++ b/ircd/m_part.c Mon Jan 19 22:10:14 2009 +0100 +diff -r 7113a0179d71 ircd/m_part.c +--- a/ircd/m_part.c Wed Jan 21 16:44:50 2009 +0100 ++++ b/ircd/m_part.c Wed Jan 21 17:13:44 2009 +0100 @@ -140,7 +140,8 @@ assert(!IsZombie(member)); /* Local users should never zombie */ @@ -435,9 +399,9 @@ diff -r f6d476f109e2 ircd/m_part.c { flags |= CHFL_BANNED; /* Remote clients don't want to see a comment either. */ -diff -r f6d476f109e2 ircd/m_quit.c ---- a/ircd/m_quit.c Mon Jan 19 15:32:18 2009 +0100 -+++ b/ircd/m_quit.c Mon Jan 19 22:10:14 2009 +0100 +diff -r 7113a0179d71 ircd/m_quit.c +--- a/ircd/m_quit.c Wed Jan 21 16:44:50 2009 +0100 ++++ b/ircd/m_quit.c Wed Jan 21 17:13:44 2009 +0100 @@ -109,8 +109,8 @@ struct Membership* chan; /* (slug for +u) removed !IsDelayedJoin(chan) as splidge said to */ @@ -449,9 +413,9 @@ diff -r f6d476f109e2 ircd/m_quit.c return exit_client(cptr, sptr, sptr, "Signed off"); } } -diff -r f6d476f109e2 ircd/m_topic.c ---- a/ircd/m_topic.c Mon Jan 19 15:32:18 2009 +0100 -+++ b/ircd/m_topic.c Mon Jan 19 22:10:14 2009 +0100 +diff -r 7113a0179d71 ircd/m_topic.c +--- a/ircd/m_topic.c Wed Jan 21 16:44:50 2009 +0100 ++++ b/ircd/m_topic.c Wed Jan 21 17:13:44 2009 +0100 @@ -144,7 +144,7 @@ } else if ((chptr->mode.mode & MODE_TOPICLIMIT) && !is_chan_op(sptr, chptr)) @@ -461,9 +425,9 @@ diff -r f6d476f109e2 ircd/m_topic.c send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname); else do_settopic(sptr,cptr,chptr,topic,0); -diff -r f6d476f109e2 ircd/m_wallchops.c ---- a/ircd/m_wallchops.c Mon Jan 19 15:32:18 2009 +0100 -+++ b/ircd/m_wallchops.c Mon Jan 19 22:10:14 2009 +0100 +diff -r 7113a0179d71 ircd/m_wallchops.c +--- a/ircd/m_wallchops.c Wed Jan 21 16:44:50 2009 +0100 ++++ b/ircd/m_wallchops.c Wed Jan 21 17:13:44 2009 +0100 @@ -103,7 +103,6 @@ { struct Channel *chptr; @@ -508,9 +472,9 @@ diff -r f6d476f109e2 ircd/m_wallchops.c sendcmdto_channel_butone(sptr, CMD_WALLCHOPS, chptr, cptr, SKIP_DEAF | SKIP_BURST | SKIP_NONOPS, "%H :%s", chptr, parv[parc - 1]); -diff -r f6d476f109e2 ircd/m_wallvoices.c ---- a/ircd/m_wallvoices.c Mon Jan 19 15:32:18 2009 +0100 -+++ b/ircd/m_wallvoices.c Mon Jan 19 22:10:14 2009 +0100 +diff -r 7113a0179d71 ircd/m_wallvoices.c +--- a/ircd/m_wallvoices.c Wed Jan 21 16:44:50 2009 +0100 ++++ b/ircd/m_wallvoices.c Wed Jan 21 17:13:44 2009 +0100 @@ -102,7 +102,6 @@ { struct Channel *chptr; diff --git a/hiskgline.patch b/hiskgline.patch index ca283f3..729c95f 100644 --- a/hiskgline.patch +++ b/hiskgline.patch @@ -1,5 +1,8 @@ tidy up HIS G-line/K-line reasons, instead of examing the quit reason, set a flag and use that to determine whether or not the quit reason shown to other users should be altered. +make clean etc. otherwise you may find that this patch breaks remote sethosts and possibly other things +but it is fine - just make sure all is compiled again + diff -r b737284f4c26 include/client.h --- a/include/client.h Sun Jan 11 22:38:41 2009 +0000 +++ b/include/client.h Sun Jan 11 22:38:41 2009 +0000 diff --git a/nserverflag.patch b/nserverflag.patch new file mode 100644 index 0000000..e28b8a4 --- /dev/null +++ b/nserverflag.patch @@ -0,0 +1,20 @@ +When we introduce a new server we got from our uplink to our downlinks, +check the IsSendOpername() against this new server +and not on the client (thus the server link) that sent us this message. + +Now the IRCd has the correct info on remote servers whether they accepted +opernames or not. + + +diff -r 0ef8d9c66131 ircd/s_serv.c +--- a/ircd/s_serv.c Wed Jan 21 18:00:00 2009 +0100 ++++ b/ircd/s_serv.c Wed Jan 21 18:25:34 2009 +0100 +@@ -231,7 +231,7 @@ + cli_hopcount(acptr) + 1, cli_serv(acptr)->timestamp, + protocol_str, Protocol(acptr), NumServCap(acptr), + IsHub(acptr) ? "h" : "", IsService(acptr) ? "s" : "", +- IsIPv6(acptr) ? "6" : "", IsSendOperName(cptr) ? "n" : "", cli_info(acptr)); ++ IsIPv6(acptr) ? "6" : "", IsSendOperName(acptr) ? "n" : "", cli_info(acptr)); + } + } + diff --git a/opername.patch b/opername.patch index 20a6c67..eef2de3 100644 --- a/opername.patch +++ b/opername.patch @@ -1,4 +1,8 @@ -Add opername to snomask, remote connect wallops, and logging +Add opername to snomask and remote connect wallops + +in form of nick(opername) +new function get_client_name_and_opername() add in s_misc.c +mirrored after get_client_name() which can return either nick/server or nick[ident@ip] diff -r dffb1fdabb12 include/client.h --- a/include/client.h Wed Jan 14 14:19:42 2009 +0100 diff --git a/remoteglinejupe.patch b/remoteglinejupe.patch index 2c7faab..0be131f 100644 --- a/remoteglinejupe.patch +++ b/remoteglinejupe.patch @@ -1,3 +1,8 @@ +oper doing some lccal gline/jupe action on a remote server +never gets a reply in case of succes + +this patch sends a copy of the snomask message shown to local opers to the remote source oper + diff -r 31a4a0514c74 ircd/gline.c --- a/ircd/gline.c Mon Jan 12 18:14:17 2009 +0100 +++ b/ircd/gline.c Mon Jan 12 18:18:57 2009 +0100 diff --git a/series b/series index edd7593..5224630 100644 --- a/series +++ b/series @@ -1,9 +1,11 @@ who-accountid.patch statsheader.patch +nserverflag.patch addnickchasetomodenick.patch #+nickchase chanopaccountabilityforkickdelayedjoin.patch addopkickcmd.patch #+opkick addhacktypetohackkick.patch +ulined.patch cansendtochan.patch hidebanowner.patch #+hidebanowner hisadmin.patch diff --git a/split.patch b/split.patch index d4e2746..02e4160 100644 --- a/split.patch +++ b/split.patch @@ -5,9 +5,11 @@ Add /stats S/split (make /STATS s/S case sensitive, s spoofhosts) Add feature SPLIT Add split.c split.h m_split.c -diff -r 64eb6d1a4c6a include/handlers.h ---- a/include/handlers.h Mon Jan 19 13:11:21 2009 +0100 -+++ b/include/handlers.h Mon Jan 19 15:03:45 2009 +0100 +NOTE: feature SPLIT is default enabled as that is just easier when working on this patch. + +diff -r bc3532fbd97a include/handlers.h +--- a/include/handlers.h Tue Jan 20 17:24:09 2009 +0100 ++++ b/include/handlers.h Tue Jan 20 17:25:52 2009 +0100 @@ -139,6 +139,7 @@ extern int m_registered(struct Client*, struct Client*, int, char*[]); extern int m_sethost(struct Client*, struct Client*, int, char*[]); @@ -32,9 +34,9 @@ diff -r 64eb6d1a4c6a include/handlers.h extern int ms_squit(struct Client*, struct Client*, int, char*[]); extern int ms_stats(struct Client*, struct Client*, int, char*[]); extern int ms_topic(struct Client*, struct Client*, int, char*[]); -diff -r 64eb6d1a4c6a include/ircd_features.h ---- a/include/ircd_features.h Mon Jan 19 13:11:21 2009 +0100 -+++ b/include/ircd_features.h Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a include/ircd_features.h +--- a/include/ircd_features.h Tue Jan 20 17:24:09 2009 +0100 ++++ b/include/ircd_features.h Tue Jan 20 17:25:52 2009 +0100 @@ -110,6 +110,10 @@ FEAT_SETHOST_USER, FEAT_SETHOST_AUTO, @@ -54,9 +56,9 @@ diff -r 64eb6d1a4c6a include/ircd_features.h FEAT_HIS_STATS_s, FEAT_HIS_STATS_t, FEAT_HIS_STATS_T, -diff -r 64eb6d1a4c6a include/msg.h ---- a/include/msg.h Mon Jan 19 13:11:21 2009 +0100 -+++ b/include/msg.h Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a include/msg.h +--- a/include/msg.h Tue Jan 20 17:24:09 2009 +0100 ++++ b/include/msg.h Tue Jan 20 17:25:53 2009 +0100 @@ -332,6 +332,10 @@ #define TOK_JUPE "JU" #define CMD_JUPE MSG_JUPE, TOK_JUPE @@ -68,9 +70,9 @@ diff -r 64eb6d1a4c6a include/msg.h #define MSG_OPMODE "OPMODE" /* OPMO */ #define TOK_OPMODE "OM" #define CMD_OPMODE MSG_OPMODE, TOK_OPMODE -diff -r 64eb6d1a4c6a include/numeric.h ---- a/include/numeric.h Mon Jan 19 13:11:21 2009 +0100 -+++ b/include/numeric.h Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a include/numeric.h +--- a/include/numeric.h Tue Jan 20 17:24:09 2009 +0100 ++++ b/include/numeric.h Tue Jan 20 17:25:53 2009 +0100 @@ -117,6 +117,7 @@ RPL_STATSVLINE 227 unreal */ #define RPL_STATSALINE 226 /* Hybrid, Undernet */ @@ -96,9 +98,9 @@ diff -r 64eb6d1a4c6a include/numeric.h #define ERR_SILELISTFULL 511 /* Undernet extension */ /* ERR_NOTIFYFULL 512 aircd */ /* ERR_TOOMANYWATCH 512 Numeric List: Dalnet */ -diff -r 64eb6d1a4c6a include/split.h +diff -r bc3532fbd97a include/split.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/include/split.h Mon Jan 19 15:03:45 2009 +0100 ++++ b/include/split.h Tue Jan 20 17:25:53 2009 +0100 @@ -0,0 +1,120 @@ +/* TODO: ifndef ? */ +#ifndef INCLUDED_jupe_h @@ -220,9 +222,9 @@ diff -r 64eb6d1a4c6a include/split.h + +/* TODO: endif ? */ +#endif /* INCLUDED_jupe_h */ -diff -r 64eb6d1a4c6a ircd/Makefile.in ---- a/ircd/Makefile.in Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/Makefile.in Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/Makefile.in +--- a/ircd/Makefile.in Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/Makefile.in Tue Jan 20 17:25:53 2009 +0100 @@ -173,6 +173,7 @@ m_sethost.c \ m_settime.c \ @@ -280,9 +282,9 @@ diff -r 64eb6d1a4c6a ircd/Makefile.in uping.o: uping.c ../config.h ../include/uping.h ../include/ircd_defs.h \ ../include/ircd_events.h ../config.h ../include/res.h \ ../include/client.h ../include/dbuf.h ../include/msgq.h \ -diff -r 64eb6d1a4c6a ircd/ircd.c ---- a/ircd/ircd.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/ircd.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/ircd.c +--- a/ircd/ircd.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/ircd.c Tue Jan 20 17:25:53 2009 +0100 @@ -55,6 +55,7 @@ #include "s_misc.h" #include "s_stats.h" @@ -301,9 +303,9 @@ diff -r 64eb6d1a4c6a ircd/ircd.c event_loop(); return 0; -diff -r 64eb6d1a4c6a ircd/ircd_features.c ---- a/ircd/ircd_features.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/ircd_features.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/ircd_features.c +--- a/ircd/ircd_features.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/ircd_features.c Tue Jan 20 17:25:53 2009 +0100 @@ -364,6 +364,10 @@ F_B(SETHOST_USER, 0, 0, 0), F_B(SETHOST_AUTO, 0, 0, 0), @@ -323,9 +325,9 @@ diff -r 64eb6d1a4c6a ircd/ircd_features.c F_B(HIS_STATS_s, 0, 1, 0), F_B(HIS_STATS_t, 0, 1, 0), F_B(HIS_STATS_T, 0, 1, 0), -diff -r 64eb6d1a4c6a ircd/m_endburst.c ---- a/ircd/m_endburst.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/m_endburst.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/m_endburst.c +--- a/ircd/m_endburst.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/m_endburst.c Tue Jan 20 17:25:53 2009 +0100 @@ -85,6 +85,7 @@ #include "client.h" #include "hash.h" @@ -361,9 +363,9 @@ diff -r 64eb6d1a4c6a ircd/m_endburst.c if (MyConnect(sptr)) sendcmdto_one(&me, CMD_END_OF_BURST_ACK, sptr, ""); -diff -r 64eb6d1a4c6a ircd/m_reburst.c ---- a/ircd/m_reburst.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/m_reburst.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/m_reburst.c +--- a/ircd/m_reburst.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/m_reburst.c Tue Jan 20 17:25:53 2009 +0100 @@ -102,6 +102,7 @@ #include "ircd_snprintf.h" #include "gline.h" @@ -383,9 +385,9 @@ diff -r 64eb6d1a4c6a ircd/m_reburst.c default: break; } -diff -r 64eb6d1a4c6a ircd/m_split.c +diff -r bc3532fbd97a ircd/m_split.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/ircd/m_split.c Mon Jan 19 15:03:45 2009 +0100 ++++ b/ircd/m_split.c Tue Jan 20 17:25:53 2009 +0100 @@ -0,0 +1,374 @@ +/* + * IRC - Internet Relay Chat, ircd/m_split.c @@ -761,9 +763,9 @@ diff -r 64eb6d1a4c6a ircd/m_split.c + + return split_list(sptr, parv[1]); +} -diff -r 64eb6d1a4c6a ircd/parse.c ---- a/ircd/parse.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/parse.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/parse.c +--- a/ircd/parse.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/parse.c Tue Jan 20 17:25:53 2009 +0100 @@ -505,6 +505,13 @@ 0, MAXPARA, MFLG_SLOW, 0, NULL, /* UNREG, CLIENT, SERVER, OPER, SERVICE */ @@ -778,9 +780,9 @@ diff -r 64eb6d1a4c6a ircd/parse.c }, { MSG_OPMODE, -diff -r 64eb6d1a4c6a ircd/s_conf.c ---- a/ircd/s_conf.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/s_conf.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/s_conf.c +--- a/ircd/s_conf.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/s_conf.c Tue Jan 20 17:25:53 2009 +0100 @@ -53,6 +53,7 @@ #include "s_debug.h" #include "s_misc.h" @@ -797,9 +799,9 @@ diff -r 64eb6d1a4c6a ircd/s_conf.c return ret; } -diff -r 64eb6d1a4c6a ircd/s_debug.c ---- a/ircd/s_debug.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/s_debug.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/s_debug.c +--- a/ircd/s_debug.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/s_debug.c Tue Jan 20 17:25:53 2009 +0100 @@ -48,6 +48,7 @@ #include "s_user.h" #include "s_stats.h" @@ -837,9 +839,9 @@ diff -r 64eb6d1a4c6a ircd/s_debug.c send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Hash: client %d(%zu), chan is the same", HASHSIZE, -diff -r 64eb6d1a4c6a ircd/s_err.c ---- a/ircd/s_err.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/s_err.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/s_err.c +--- a/ircd/s_err.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/s_err.c Tue Jan 20 17:25:53 2009 +0100 @@ -490,7 +490,7 @@ /* 228 */ { RPL_STATSQLINE, "Q %s :%s", "228" }, @@ -870,9 +872,9 @@ diff -r 64eb6d1a4c6a ircd/s_err.c /* 511 */ { ERR_SILELISTFULL, "%s :Your silence list is full", "511" }, /* 512 */ -diff -r 64eb6d1a4c6a ircd/s_misc.c ---- a/ircd/s_misc.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/s_misc.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/s_misc.c +--- a/ircd/s_misc.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/s_misc.c Tue Jan 20 17:25:53 2009 +0100 @@ -53,6 +53,7 @@ #include "s_stats.h" #include "s_user.h" @@ -889,11 +891,12 @@ diff -r 64eb6d1a4c6a ircd/s_misc.c assert(killer); if (MyConnect(victim)) { -@@ -497,6 +499,14 @@ +@@ -497,6 +499,15 @@ sendto_opmask_butone(0, SNO_NETWORK, "Net break: %C %C (%s)", cli_serv(victim)->up, victim, comment); dump_map(victim, "*", 0, report_lost_links, 0); + if (feature_bool(FEAT_SPLIT)) { ++ /* TODO: remote & local SQUIT ? servername oper is on? */ + ircd_snprintf(0, splitreason, sizeof(splitreason), + "Net break: %C %C (%s%s%s%s)", cli_serv(victim)->up, victim, + IsUser(killer) ? "SQUIT by " : "", IsUser(killer) ? cli_name(killer) : "", @@ -904,9 +907,9 @@ diff -r 64eb6d1a4c6a ircd/s_misc.c } /* -diff -r 64eb6d1a4c6a ircd/s_serv.c ---- a/ircd/s_serv.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/s_serv.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/s_serv.c +--- a/ircd/s_serv.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/s_serv.c Tue Jan 20 17:25:53 2009 +0100 @@ -54,6 +54,7 @@ #include "s_misc.h" #include "s_user.h" @@ -923,9 +926,9 @@ diff -r 64eb6d1a4c6a ircd/s_serv.c /* * Pass on my client information to the new server -diff -r 64eb6d1a4c6a ircd/s_stats.c ---- a/ircd/s_stats.c Mon Jan 19 13:11:21 2009 +0100 -+++ b/ircd/s_stats.c Mon Jan 19 15:03:45 2009 +0100 +diff -r bc3532fbd97a ircd/s_stats.c +--- a/ircd/s_stats.c Tue Jan 20 17:24:09 2009 +0100 ++++ b/ircd/s_stats.c Tue Jan 20 17:25:53 2009 +0100 @@ -52,6 +52,7 @@ #include "s_stats.h" #include "s_user.h" @@ -946,9 +949,9 @@ diff -r 64eb6d1a4c6a ircd/s_stats.c stats_sline, 0, "Spoofed hosts information." }, { 'T', "motds", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_T, -diff -r 64eb6d1a4c6a ircd/split.c +diff -r bc3532fbd97a ircd/split.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/ircd/split.c Mon Jan 19 15:03:45 2009 +0100 ++++ b/ircd/split.c Tue Jan 20 17:25:53 2009 +0100 @@ -0,0 +1,771 @@ +/* + * IRC - Internet Relay Chat, ircd/split.c diff --git a/statsheader.patch b/statsheader.patch index 7ad005c..e3c1fbb 100644 --- a/statsheader.patch +++ b/statsheader.patch @@ -1,4 +1,5 @@ -add header to /STATS output and make TOTAL: line in /STATS z more clear. +Add header to /STATS output and make TOTAL: line in /STATS z more clear, +so that we do not need to guess or lookup what exactly some of the output means. diff -r 92f6cb6562e2 include/numeric.h --- a/include/numeric.h Tue Jan 13 22:17:04 2009 +0000 diff --git a/ulined.patch b/ulined.patch new file mode 100644 index 0000000..5f228c5 --- /dev/null +++ b/ulined.patch @@ -0,0 +1,46 @@ +m_sethost.c +change requirement that remote sethost comes from U:lined server +to require that it comes from a service server (+s flag) + +m_mode.c +change that mode changes by service server (+s flag) goes to HACK4 +other server mode changes to HACK3 +(was U:lined server to HACK4, else HACK3) + +U:lined - we need learn what this does nowadays. + +Other than the HACK4 or HACK3 choice, there seems to be something with +server introduction (a U:lined server is not allowed to introduce a new server +when that leads to a loop?) and also, any downlinks a U:lined server has +are also marked as U:lined. + +No other differences found for U:lined vs. non-U:lined servers. + +diff -r f1b5d42273f5 ircd/m_mode.c +--- a/ircd/m_mode.c Tue Jan 20 16:58:13 2009 +0100 ++++ b/ircd/m_mode.c Tue Jan 20 17:20:10 2009 +0100 +@@ -212,7 +212,7 @@ + ClrFlag(sptr, FLAG_TS8); + + if (IsServer(sptr)) { +- if (find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD)) ++ if (IsService(sptr)) /* server is a service so HACK4 */ + modebuf_init(&mbuf, sptr, cptr, chptr, + (MODEBUF_DEST_CHANNEL | /* Send mode to clients */ + MODEBUF_DEST_SERVER | /* Send mode to servers */ +diff -r f1b5d42273f5 ircd/m_sethost.c +--- a/ircd/m_sethost.c Tue Jan 20 16:58:13 2009 +0100 ++++ b/ircd/m_sethost.c Tue Jan 20 17:20:10 2009 +0100 +@@ -193,8 +193,10 @@ + return 0; + + /* Fake host assignments must be from services */ +- if (!find_conf_byhost(cli_confs(sptr), cli_name(sptr), CONF_UWORLD)) +- return protocol_violation(cptr, "Non-U:lined server %s set fake host on user %s", cli_name(sptr), cli_name(target)); ++ if (!IsService(sptr)) ++ return protocol_violation(cptr, ++ "Non-service server %C tried to set fake host on user %C (%s@%s)", ++ sptr, target, parv[2], parv[3]); + + if (!MyConnect(target)) { + sendcmdto_one(sptr, CMD_SETHOST, cli_user(target)->server, "%C %s %s", target, diff --git a/whoban.patch b/whoban.patch index 1879399..ba86534 100644 --- a/whoban.patch +++ b/whoban.patch @@ -1,4 +1,18 @@ -add account into ban owner info +Add account into ban owner info + +When an unauthed client sets a ban, nick is saved as owner of the ban, +when the client is authed, account.users.quakenet.org is saved. + +This should not break clients as servernames can (and did appear there +in asuka) and probably appear there in other IRCDs. Forcing a nick!user@host +format seems odd, *!*@account.users.quakenet.org seems a bit ugly, and saving +the nick and user part too costs even more and adds little, acocunt is the most +significant piece of info there already. + +What about a channel service like Q: +Should we then save Q.users.quakenet.org, or simply stick to Q +Q, or rather in general, a channel service normally does not change nicks? +and since Q does set quite a lot of bans (and topics), this might save a bit on bandwidth. diff -r bde54f5247bf include/channel.h --- a/include/channel.h Mon Jan 12 18:28:44 2009 +0100 diff --git a/whotopic.patch b/whotopic.patch index 6a8e026..a48d42b 100644 --- a/whotopic.patch +++ b/whotopic.patch @@ -1,4 +1,6 @@ -topic by info is either 'nick' or '*account' +Topic by info is either 'nick' or '*account' + +See info in whoban.patch diff -r cf06941d928b include/channel.h --- a/include/channel.h Mon Jan 12 15:14:47 2009 +0100