From: Michael Poole Date: Sun, 13 Nov 2005 15:28:17 +0000 (+0000) Subject: Fix bugs relating to joining zannels for a quick release. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=48697dab023490a2b2d650fcdde8f9ff1ebdd0e0 Fix bugs relating to joining zannels for a quick release. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1546 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 11955ce..daad290 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-11-13 Michael Poole + + * include/patchlevel.h (PATCHLEVEL): Update for release. + +2005-11-13 Carlo Wood + + * ircd/m_create (ms_create): Accept CREATE for zannels. + + * ircd/m_join.c (m_join): MODE +o for a zannel must come from the + server for compatibility with older versions. + 2005-11-12 Michael Poole * include/patchlevel.h (PATCHLEVEL): Bump for pre03. diff --git a/include/patchlevel.h b/include/patchlevel.h index 678dda2..3241de9 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -18,7 +18,7 @@ * $Id$ * */ -#define PATCHLEVEL "pre03" +#define PATCHLEVEL "03" #define RELEASE ".12." diff --git a/ircd/m_create.c b/ircd/m_create.c index 8219f09..6cb3db2 100644 --- a/ircd/m_create.c +++ b/ircd/m_create.c @@ -168,7 +168,27 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) /* Check if we need to bounce a mode */ if (TStime() - chanTS > TS_LAG_TIME || (chptr->creationtime && chanTS > chptr->creationtime && - chptr->creationtime != MAGIC_REMOTE_JOIN_TS)) { + chptr->creationtime != MAGIC_REMOTE_JOIN_TS && + /* Accept CREATE for zannels. This is only really necessary on a network + with servers prior to 2.10.12.02: we just accept their TS and ignore + the fact that it was a zannel. The influence of this on a network + that is completely 2.10.12.03 or higher is neglectable: Normally + a server only sends a CREATE after first sending a DESTRUCT. Thus, + by receiving a CREATE for a zannel one of two things happened: + 1. The DESTRUCT was sent during a net.break; this could mean that + our zannel is at the verge of expiring too, it should have been + destructed. It is correct to copy the newer TS now, all modes + already have been reset, so it will be as if it was destructed + and immediately recreated. In order to avoid desyncs of modes, + we don't accept a CREATE for channels that have +A set. + 2. The DESTRUCT passed, then someone created the channel on our + side and left it again. In this situation we have a near + simultaneous creation on two servers; the person on our side + already left within the time span of a message propagation. + The channel will therefore be less than 48 hours old and no + 'protection' is necessary. + */ + !(chptr->users == 0 && !chptr->mode.apass[0]))) { modebuf_init(&mbuf, sptr, cptr, chptr, (MODEBUF_DEST_SERVER | /* Send mode to server */ MODEBUF_DEST_HACK2 | /* Send a HACK(2) message */ diff --git a/ircd/m_join.c b/ircd/m_join.c index 9056c07..b5a675c 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -245,10 +245,18 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) joinbuf_join(&join, chptr, flags); if (flags & CHFL_CHANOP) { + struct ModeBuf mbuf; +#if 0 /* Send a MODE to the other servers. If the user used the A/U pass, * let his server op him, otherwise let him op himself. */ - struct ModeBuf mbuf; modebuf_init(&mbuf, chptr->mode.apass[0] ? &me : sptr, cptr, chptr, MODEBUF_DEST_SERVER); +#else + /* Always let the server op him: this is needed on a net with older servers + because they 'destruct' channels immediately when they become empty without + sending out a DESTRUCT message. As a result, they would always bounce a mode + (as HACK(2)) when the user ops himself. */ + modebuf_init(&mbuf, &me, cptr, chptr, MODEBUF_DEST_SERVER); +#endif modebuf_mode_client(&mbuf, MODE_ADD | MODE_CHANOP, sptr, chptr->mode.apass[0] ? ((flags & CHFL_CHANNEL_MANAGER) ? 0 : 1) : MAXOPLEVEL); modebuf_flush(&mbuf);