Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-11-13 16:01:08 UTC
Modified files:
ChangeLog ircd/m_create.c ircd/m_join.c
Log message:
Fix bugs relating to joining zannels.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.735 ircu2.10/ChangeLog:1.736
--- ircu2.10/ChangeLog:1.735 Sat Nov 12 18:05:35 2005
+++ ircu2.10/ChangeLog Sun Nov 13 08:00:58 2005
@@ -1,3 +1,10 @@
+2005-11-13 Carlo Wood <[EMAIL PROTECTED]>
+
+ * 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-11 Michael Poole <[EMAIL PROTECTED]>
* doc/readme.cvs: Document tag name consistently with the release
Index: ircu2.10/ircd/m_create.c
diff -u ircu2.10/ircd/m_create.c:1.18 ircu2.10/ircd/m_create.c:1.19
--- ircu2.10/ircd/m_create.c:1.18 Mon Sep 26 19:41:57 2005
+++ ircu2.10/ircd/m_create.c Sun Nov 13 08:00:58 2005
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_create.c,v 1.18 2005/09/27 02:41:57 entrope Exp $
+ * $Id: m_create.c,v 1.19 2005/11/13 16:00:58 entrope Exp $
*/
/*
@@ -168,7 +168,27 @@
/* 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 */
Index: ircu2.10/ircd/m_join.c
diff -u ircu2.10/ircd/m_join.c:1.38 ircu2.10/ircd/m_join.c:1.39
--- ircu2.10/ircd/m_join.c:1.38 Mon Oct 31 15:17:29 2005
+++ ircu2.10/ircd/m_join.c Sun Nov 13 08:00:58 2005
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_join.c,v 1.38 2005/10/31 23:17:29 entrope Exp $
+ * $Id: m_join.c,v 1.39 2005/11/13 16:00:58 entrope Exp $
*/
#include "config.h"
@@ -245,10 +245,18 @@
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);
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches