Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2005-05-03 03:47:52 UTC

Modified files:
     ChangeLog include/numeric.h ircd/channel.c ircd/ircd_auth.c
     ircd/m_invite.c ircd/numnicks.c ircd/s_err.c

Log message:

Prohibit same +A and +U pass; fix IAuth crash (#1193808), invite
forwarding bug (also reported by jast), and IP numnick parsing bug.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.619 ircu2.10/ChangeLog:1.620
--- ircu2.10/ChangeLog:1.619    Sun May  1 09:10:40 2005
+++ ircu2.10/ChangeLog  Mon May  2 20:47:40 2005
@@ -1,3 +1,23 @@
+2005-05-02  Michael Poole <[EMAIL PROTECTED]>
+
+       * include/numeric.h (ERR_UPASS_SAME_APASS): New error message when
+       trying to set +U pass to the same as the +A pass.
+
+       * ircd/channel.c (mode_parse_upass): Use it.
+
+       * ircd/ircd_auth.c (iauth_exit_client): Only send ExitUser if
+       there is an active IAuth connection, fixing PR#1193808.
+       (iauth_dispose_request): Only delete the timer if it is active.
+
+       * ircd/m_invite.c (m_invite): Always forward the invite in the
+       correct direction, and then skip it as 'one' if announcing.
+       (ms_invite): Likewise.
+
+       * ircd/numnicks.c (base64toip): Do not interpret AAAAAA as
+       ::ffff:0.0.0.0; keep it as ::.
+
+       * ircd/s_err.c (replyTable): Add ERR_UPASS_SAME_APASS.
+
 2005-05-01  Michael Poole <[EMAIL PROTECTED]>
 
        * doc/readme.log: Document IAUTH log target, remove docs for
Index: ircu2.10/include/numeric.h
diff -u ircu2.10/include/numeric.h:1.37 ircu2.10/include/numeric.h:1.38
--- ircu2.10/include/numeric.h:1.37     Wed Apr  6 19:10:22 2005
+++ ircu2.10/include/numeric.h  Mon May  2 20:47:41 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Declarations of numeric replies and supporting functions.
- * @version $Id: numeric.h,v 1.37 2005/04/07 02:10:22 entrope Exp $
+ * @version $Id: numeric.h,v 1.38 2005/05/03 03:47:41 entrope Exp $
  */
 #ifndef INCLUDED_numeric_h
 #define INCLUDED_numeric_h
@@ -463,7 +463,8 @@
 #define ERR_UPASSNOTSET      554       /* Undernet extension */
 #define ERR_NOMANAGER_LONG   555       /* Undernet extension */
 #define ERR_NOMANAGER_SHORT  556       /* Undernet extension */
-#define ERR_LASTERROR        557
+#define ERR_UPASS_SAME_APASS 557        /* Undernet extension */
+#define ERR_LASTERROR        558
 
 /*     RPL_LOGON            600        dalnet,unreal
        RPL_LOGOFF           601        dalnet,unreal
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.127 ircu2.10/ircd/channel.c:1.128
--- ircu2.10/ircd/channel.c:1.127       Sat Apr 23 18:41:00 2005
+++ ircu2.10/ircd/channel.c     Mon May  2 20:47:42 2005
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.127 2005/04/24 01:41:00 entrope Exp $
+ * @version $Id: channel.c,v 1.128 2005/05/03 03:47:42 entrope Exp $
  */
 #include "config.h"
 
@@ -2484,6 +2484,11 @@
       send_reply(state->sptr, ERR_UPASSNOTSET, state->chptr->chname, 
state->chptr->chname);
       return;
     }
+    /* cannot set a +U password that is the same as +A */
+    if (state->dir == MODE_ADD && !ircd_strcmp(state->chptr->mode.apass, 
t_str)) {
+      send_reply(state->sptr, ERR_UPASS_SAME_APASS, state->chptr->chname);
+      return;
+    }
     /* can't add a upass if one is set, nor can one remove the wrong upass */
     if ((state->dir == MODE_ADD && *state->chptr->mode.upass) ||
        (state->dir == MODE_DEL &&
Index: ircu2.10/ircd/ircd_auth.c
diff -u ircu2.10/ircd/ircd_auth.c:1.15 ircu2.10/ircd/ircd_auth.c:1.16
--- ircu2.10/ircd/ircd_auth.c:1.15      Sun May  1 09:11:01 2005
+++ ircu2.10/ircd/ircd_auth.c   Mon May  2 20:47:42 2005
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief IAuth client implementation for an IRC server.
- * @version $Id: ircd_auth.c,v 1.15 2005/05/01 16:11:01 entrope Exp $
+ * @version $Id: ircd_auth.c,v 1.16 2005/05/03 03:47:42 entrope Exp $
  */
 
 #include "config.h"
@@ -721,10 +721,10 @@
     iauth_dispose_request(iauth_active, cli_iauth(cptr));
     cli_iauth(cptr) = NULL;
   }
-  if (!i_GetConnected(iauth_active))
-    return;
-  iauth_send(iauth_active, "ExitUser %x", cptr);
-  iauth_write(iauth_active);
+  if (iauth_active && i_GetConnected(iauth_active)) {
+    iauth_send(iauth_active, "ExitUser %x", cptr);
+    iauth_write(iauth_active);
+  }
 }
 
 /** Find pending request with a particular ID.
@@ -754,7 +754,7 @@
 static void iauth_dispose_request(struct IAuth *iauth, struct IAuthRequest 
*iar)
 {
   assert(iar->iar_client != NULL);
-  if (iar->iar_timed)
+  if (iar->iar_timed && t_active(&i_request_timer(iauth)))
     timer_del(&i_request_timer(iauth));
   cli_iauth(iar->iar_client) = NULL;
   iar->iar_prev->iar_next = iar->iar_next;
Index: ircu2.10/ircd/m_invite.c
diff -u ircu2.10/ircd/m_invite.c:1.20 ircu2.10/ircd/m_invite.c:1.21
--- ircu2.10/ircd/m_invite.c:1.20       Sun Apr 24 20:35:54 2005
+++ ircu2.10/ircd/m_invite.c    Mon May  2 20:47:42 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_invite.c,v 1.20 2005/04/25 03:35:54 entrope Exp $
+ * $Id: m_invite.c,v 1.21 2005/05/03 03:47:42 entrope Exp $
  */
 
 /*
@@ -180,6 +180,9 @@
   if (MyConnect(acptr)) {
     add_invite(acptr, chptr);
     sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr);
+  } else {
+    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr,
+                  chptr->creationtime);
   }
 
   if (!IsLocalChannel(chptr->chname) || MyConnect(acptr)) {
@@ -190,7 +193,7 @@
                                        "%H %C %C :%C has been invited by %C",
                                        chptr, acptr, sptr, acptr, sptr);
       /* Announce to servers with channel operators. */
-      sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, NULL, 
SKIP_NONOPS,
+      sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, 
SKIP_NONOPS,
                                        "%s %H %Tu", cli_name(acptr),
                                        chptr, chptr->creationtime);
     }
@@ -280,8 +283,11 @@
     return 0;
 
   if (MyConnect(acptr)) {
-      add_invite(acptr, chptr);
-      sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr);
+    add_invite(acptr, chptr);
+    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr);
+  } else {
+    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr,
+                  chptr->creationtime);
   }
 
   if (feature_bool(FEAT_ANNOUNCE_INVITES)) {
@@ -291,12 +297,10 @@
                                      "%H %C %C :%C has been invited by %C",
                                      chptr, acptr, sptr, acptr, sptr);
     /* Announce to servers with channel operators. */
-    sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, NULL, 
SKIP_NONOPS,
+    sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, 
SKIP_NONOPS,
                                      "%s %H %Tu", cli_name(acptr), chptr,
                                      chptr->creationtime);
   }
 
   return 0;
 }
-
-
Index: ircu2.10/ircd/numnicks.c
diff -u ircu2.10/ircd/numnicks.c:1.28 ircu2.10/ircd/numnicks.c:1.29
--- ircu2.10/ircd/numnicks.c:1.28       Wed Apr 20 19:35:17 2005
+++ ircu2.10/ircd/numnicks.c    Mon May  2 20:47:42 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Implementation of numeric nickname operations.
- * @version $Id: numnicks.c,v 1.28 2005/04/21 02:35:17 entrope Exp $
+ * @version $Id: numnicks.c,v 1.29 2005/05/03 03:47:42 entrope Exp $
  */
 #include "config.h"
 
@@ -502,9 +502,12 @@
   memset(addr, 0, sizeof(*addr));
   if (strlen(input) == 6) {
     unsigned int in = base64toint(input);
-    addr->in6_16[5] = htons(65535);
-    addr->in6_16[6] = htons(in >> 16);
-    addr->in6_16[7] = htons(in & 65535);
+    /* An all-zero address should stay that way. */
+    if (in) {
+      addr->in6_16[5] = htons(65535);
+      addr->in6_16[6] = htons(in >> 16);
+      addr->in6_16[7] = htons(in & 65535);
+    }
   } else {
     unsigned int pos = 0;
     do {
Index: ircu2.10/ircd/s_err.c
diff -u ircu2.10/ircd/s_err.c:1.66 ircu2.10/ircd/s_err.c:1.67
--- ircu2.10/ircd/s_err.c:1.66  Sat Apr 16 19:57:57 2005
+++ ircu2.10/ircd/s_err.c       Mon May  2 20:47:42 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Error handling support.
- * @version $Id: s_err.c,v 1.66 2005/04/17 02:57:57 entrope Exp $
+ * @version $Id: s_err.c,v 1.67 2005/05/03 03:47:42 entrope Exp $
  */
 #include "config.h"
 
@@ -1146,7 +1146,7 @@
 /* 556 */
   { ERR_NOMANAGER_SHORT, "%s :Re-create the channel.  The channel must be 
*empty* for a minute or two before it can be recreated.", "556" },
 /* 557 */
-  { 0 },
+  { ERR_UPASS_SAME_APASS, "%s :Cannot use the same pass for both admin (+A) 
and user (+U) pass.", "557" },
 /* 558 */
   { 0 },
 /* 559 */
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to