Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2006-06-27 00:11:27 UTC

Modified files:
     ChangeLog doc/example.conf doc/readme.features ircd/gline.c
     ircd/ircd_lexer.l ircd/ircd_parser.y ircd/m_gline.c ircd/m_pass.c
     ircd/m_stats.c ircd/m_whois.c ircd/s_auth.c ircd/s_err.c

Log message:

Synchronize CVS HEAD with u2_10_12_branch through u2_10_12_07.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.776 ircu2.10/ChangeLog:1.777
--- ircu2.10/ChangeLog:1.776    Thu Jun  1 08:59:18 2006
+++ ircu2.10/ChangeLog  Mon Jun 26 17:11:17 2006
@@ -1,3 +1,62 @@
+2006-06-17  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/m_pass.c (mr_pass): Only back 'len' up when it's safe.
+
+2006-06-08  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/m_whois.c (do_whois): Prefix '*' to names of secret (local)
+       channels for locops as well as global opers.
+
+2006-06-08  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/m_gline.c (ms_gline): Use final argument as G-line reason.
+
+2006-06-08  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/gline.c (gline_stats): Show activation state in /stats g.
+
+       * ircd/s_err.c (RPL_STATSGLINE): Update format string to match.
+
+2006-06-07  Michael Poole <[EMAIL PROTECTED]>
+
+       * doc/example.conf: Document the list_chan privilege.
+
+       * ircd/ircd_lexer.l: Recognize the token.
+
+       * ircd/ircd_parser.y: Treat it appropriately.
+
+2006-06-07  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/s_auth.c (auth_ping_timeout): If the client never had an
+       auth request, kill them on ping timeout.
+
+2006-06-05  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/s_auth.c (auth_timeout_callback): Clear AR_DNS_PENDING when
+       destroying the lookup and reporting DNS failure.
+
+2006-05-28  Michael Poole <[EMAIL PROTECTED]>
+
+       * doc/readme.features (MAXBANS): Update default value.
+       (NICKLEN): Likewise.
+       (HIS_STATS_*): Sort alphabetically.
+
+       * ircd/m_stats.c (m_stats): Describe the intention so that there
+       are not further questions about local opers and remote /stats.
+       Fix places that use cptr instead of sptr.
+
+2006-05-24  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/s_auth.c (auth_dns_callback): Be more careful about
+       handling failed DNS lookups.  Use a more standard function to
+       disconnect clients for IP mismatches.
+       (start_auth): Use a more standard function to disconnect clients
+       for peer or local socket address lookup failures.
+
+2006-05-17  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/s_auth.c (auth_ping_timeout): Fix off-by-one error.
+
 2006-06-01  Kevin L. Mitchell  <[EMAIL PROTECTED]>
 
        * ircd/ircd_features.c: add FEAT_DEP to mark deprecated features
Index: ircu2.10/doc/example.conf
diff -u ircu2.10/doc/example.conf:1.69 ircu2.10/doc/example.conf:1.70
--- ircu2.10/doc/example.conf:1.69      Thu Jun  1 08:59:18 2006
+++ ircu2.10/doc/example.conf   Mon Jun 26 17:11:17 2006
@@ -202,6 +202,7 @@
  # local_gline (can set a G-line for this server only)
  # local_badchan (can set a Gchan for this server only)
  # see_chan (can see users in +s channels in /WHO)
+ # list_chan (can see +s channels with /LIST S)
  # wide_gline (can use ! to force a wide G-line)
  # see_opers (can see opers without DISPLAY privilege)
  # local_opmode (can use OPMODE/CLEARMODE on local channels)
Index: ircu2.10/doc/readme.features
diff -u ircu2.10/doc/readme.features:1.24 ircu2.10/doc/readme.features:1.25
--- ircu2.10/doc/readme.features:1.24   Thu Jun  1 08:59:19 2006
+++ ircu2.10/doc/readme.features        Mon Jun 26 17:11:17 2006
@@ -293,7 +293,7 @@
 
 MAXBANS
  * Type: integer
- * Default: 30
+ * Default: 45
 
 This is the maximum number of bans a user may set on a given channel.
 
@@ -761,7 +761,7 @@
 
 NICKLEN
  * Type: integer
- * Default: 9
+ * Default: 12
 
 This is the allowed length of the nickname length.  It may not be
 larger than the NICKLEN #define, and should usually be the same
Index: ircu2.10/ircd/gline.c
diff -u ircu2.10/ircd/gline.c:1.63 ircu2.10/ircd/gline.c:1.64
--- ircu2.10/ircd/gline.c:1.63  Fri Jan  6 03:22:31 2006
+++ ircu2.10/ircd/gline.c       Mon Jun 26 17:11:17 2006
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Implementation of Gline manipulation functions.
- * @version $Id: gline.c,v 1.63 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: gline.c,v 1.64 2006/06/27 00:11:17 entrope Exp $
  */
 #include "config.h"
 
@@ -899,7 +899,9 @@
       send_reply(sptr, RPL_STATSGLINE, 'G', gline->gl_user,
                  gline->gl_host ? "@" : "",
                  gline->gl_host ? gline->gl_host : "",
-                gline->gl_expire + TSoffset, gline->gl_reason);
+                gline->gl_expire + TSoffset,
+                 GlineIsActive(gline) ? '+' : '-',
+                 gline->gl_reason);
   }
 }
 
Index: ircu2.10/ircd/ircd_lexer.l
diff -u ircu2.10/ircd/ircd_lexer.l:1.23 ircu2.10/ircd/ircd_lexer.l:1.24
--- ircu2.10/ircd/ircd_lexer.l:1.23     Thu Apr  6 20:27:50 2006
+++ ircu2.10/ircd/ircd_lexer.l  Mon Jun 26 17:11:17 2006
@@ -17,7 +17,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  *  USA.
- * $Id: ircd_lexer.l,v 1.23 2006/04/07 03:27:50 entrope Exp $
+ * $Id: ircd_lexer.l,v 1.24 2006/06/27 00:11:17 entrope Exp $
  */
 
 %{
@@ -119,6 +119,7 @@
   { "gline", TPRIV_GLINE },
   { "kb", KBYTES },
   { "kilobytes", KBYTES },
+  { "list_chan", TPRIV_LIST_CHAN },
   { "local_badchan", TPRIV_LOCAL_BADCHAN },
   { "local_gline", TPRIV_LOCAL_GLINE },
   { "local_jupe", TPRIV_LOCAL_JUPE },
Index: ircu2.10/ircd/ircd_parser.y
diff -u ircu2.10/ircd/ircd_parser.y:1.62 ircu2.10/ircd/ircd_parser.y:1.63
--- ircu2.10/ircd/ircd_parser.y:1.62    Sun May 14 12:31:30 2006
+++ ircu2.10/ircd/ircd_parser.y Mon Jun 26 17:11:17 2006
@@ -17,7 +17,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  *  USA.
- * $Id: ircd_parser.y,v 1.62 2006/05/14 19:31:30 entrope Exp $
+ * $Id: ircd_parser.y,v 1.63 2006/06/27 00:11:17 entrope Exp $
  */
 %{
 
@@ -164,6 +164,7 @@
 %token TPRIV_SEE_CHAN TPRIV_SHOW_INVIS TPRIV_SHOW_ALL_INVIS TPRIV_PROPAGATE
 %token TPRIV_UNLIMIT_QUERY TPRIV_DISPLAY TPRIV_SEE_OPERS TPRIV_WIDE_GLINE
 %token TPRIV_FORCE_OPMODE TPRIV_FORCE_LOCAL_OPMODE TPRIV_APASS_OPMODE
+%token TPRIV_LIST_CHAN
 /* and some types... */
 %type <num> sizespec
 %type <num> timespec timefactor factoredtimes factoredtime
@@ -615,6 +616,7 @@
           TPRIV_DISPLAY { $$ = PRIV_DISPLAY; } |
           TPRIV_SEE_OPERS { $$ = PRIV_SEE_OPERS; } |
           TPRIV_WIDE_GLINE { $$ = PRIV_WIDE_GLINE; } |
+          TPRIV_LIST_CHAN { $$ = PRIV_LIST_CHAN; } |
           LOCAL { $$ = PRIV_PROPAGATE; invert = 1; } |
           TPRIV_FORCE_OPMODE { $$ = PRIV_FORCE_OPMODE; } |
           TPRIV_FORCE_LOCAL_OPMODE { $$ = PRIV_FORCE_LOCAL_OPMODE; } |
Index: ircu2.10/ircd/m_gline.c
diff -u ircu2.10/ircd/m_gline.c:1.27 ircu2.10/ircd/m_gline.c:1.28
--- ircu2.10/ircd/m_gline.c:1.27        Tue Oct  4 19:43:56 2005
+++ ircu2.10/ircd/m_gline.c     Mon Jun 26 17:11:17 2006
@@ -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_gline.c,v 1.27 2005/10/05 02:43:56 entrope Exp $
+ * $Id: m_gline.c,v 1.28 2006/06/27 00:11:17 entrope Exp $
  */
 
 /*
@@ -139,18 +139,16 @@
     if (!find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD))
       return need_more_params(sptr, "GLINE");
 
-    if (parc > 4)
-      reason = parv[4];
     flags |= GLINE_FORCE;
   }
   else if (parc > 5)
-  {
     lastmod = atoi(parv[4]);
-    reason = parv[5];
-  }
   else
     return need_more_params(sptr, "GLINE");
 
+  if (parc > 4)
+    reason = parv[parc - 1];
+
   if (IsServer(sptr))
     flags |= GLINE_FORCE;
 
Index: ircu2.10/ircd/m_pass.c
diff -u ircu2.10/ircd/m_pass.c:1.9 ircu2.10/ircd/m_pass.c:1.10
--- ircu2.10/ircd/m_pass.c:1.9  Thu Apr  6 20:27:50 2006
+++ ircu2.10/ircd/m_pass.c      Mon Jun 26 17:11:17 2006
@@ -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_pass.c,v 1.9 2006/04/07 03:27:50 entrope Exp $
+ * $Id: m_pass.c,v 1.10 2006/06/27 00:11:17 entrope Exp $
  */
 
 /*
@@ -112,7 +112,9 @@
     len += strlen(parv[arg]);
     password[len++] = ' ';
   }
-  password[--len] = '\0';
+  if (len > 0)
+    --len;
+  password[len] = '\0';
 
   if (EmptyString(password))
     return need_more_params(cptr, "PASS");
Index: ircu2.10/ircd/m_stats.c
diff -u ircu2.10/ircd/m_stats.c:1.32 ircu2.10/ircd/m_stats.c:1.33
--- ircu2.10/ircd/m_stats.c:1.32        Tue Oct 11 13:32:24 2005
+++ ircu2.10/ircd/m_stats.c     Mon Jun 26 17:11:17 2006
@@ -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_stats.c,v 1.32 2005/10/11 20:32:24 isomer Exp $
+ * $Id: m_stats.c,v 1.33 2006/06/27 00:11:17 entrope Exp $
  */
 
 /*
@@ -121,7 +121,7 @@
   const struct StatDesc *sd;
   char *param = 0;
 
-  /* If we didn't find a descriptor and this is my client, send them help */
+  /* If we didn't find a descriptor, send them help */
   if ((parc < 2) || !(sd = stats_find(parv[1])))
       parv[1] = "*", sd = stats_find("*");
 
@@ -131,15 +131,18 @@
    * not privileged (server or an operator), then the STAT_FLAG_OPERONLY
    * flag must not be set, and if the STAT_FLAG_OPERFEAT flag is set,
    * then the feature given by sd->sd_control must be off.
+   *
+   * This checks cptr rather than sptr so that a local oper may send
+   * /stats queries to other servers.
    */
   if (!IsPrivileged(cptr) &&
       ((sd->sd_flags & STAT_FLAG_OPERONLY) ||
        ((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control))))
-    return send_reply(cptr, ERR_NOPRIVILEGES);
+    return send_reply(sptr, ERR_NOPRIVILEGES);
 
   /* Check if they are a local user */
-  if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(cptr))
-    return send_reply(cptr, ERR_NOPRIVILEGES);
+  if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(sptr))
+    return send_reply(sptr, ERR_NOPRIVILEGES);
 
   /* Check for extra parameter */
   if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
Index: ircu2.10/ircd/m_whois.c
diff -u ircu2.10/ircd/m_whois.c:1.38 ircu2.10/ircd/m_whois.c:1.39
--- ircu2.10/ircd/m_whois.c:1.38        Fri Sep 30 20:37:43 2005
+++ ircu2.10/ircd/m_whois.c     Mon Jun 26 17:11:17 2006
@@ -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_whois.c,v 1.38 2005/10/01 03:37:43 entrope Exp $
+ * $Id: m_whois.c,v 1.39 2006/06/27 00:11:17 entrope Exp $
  */
 
 /*
@@ -178,7 +178,7 @@
        }
        if (IsDeaf(acptr))
          *(buf + len++) = '-';
-       if (IsOper(sptr) && !ShowChannel(sptr, chptr))
+       if (!ShowChannel(sptr, chptr))
          *(buf + len++) = '*';
        if (IsDelayedJoin(chan) && (sptr != acptr))
          *(buf + len++) = '<';
Index: ircu2.10/ircd/s_auth.c
diff -u ircu2.10/ircd/s_auth.c:1.43 ircu2.10/ircd/s_auth.c:1.44
--- ircu2.10/ircd/s_auth.c:1.43 Mon May 15 20:37:38 2006
+++ ircu2.10/ircd/s_auth.c      Mon Jun 26 17:11:17 2006
@@ -31,7 +31,7 @@
  */
 /** @file
  * @brief Implementation of DNS and ident lookups.
- * @version $Id: s_auth.c,v 1.43 2006/05/16 03:37:38 entrope Exp $
+ * @version $Id: s_auth.c,v 1.44 2006/06/27 00:11:17 entrope Exp $
  */
 #include "config.h"
 
@@ -733,8 +733,13 @@
 
   auth = cli_auth(cptr);
 
+  /* Check whether the auth request is gone (more likely, it never
+   * existed, as in an outbound server connection). */
+  if (!auth)
+      return exit_client_msg(cptr, cptr, &me, "Registration Timeout");
+
   /* Check for a user-controlled timeout. */
-  for (flag = 0; flag < AR_LAST_SCAN; ++flag) {
+  for (flag = 0; flag <= AR_LAST_SCAN; ++flag) {
     if (FlagHas(&auth->flags, flag)) {
       /* Display message if they have sent a NICK and a USER but no
        * nospoof PONG.
@@ -792,6 +797,7 @@
 
     /* Likewise if dns lookup failed. */
     if (FlagHas(&auth->flags, AR_DNS_PENDING)) {
+      FlagClr(&auth->flags, AR_DNS_PENDING);
       delete_resolver_queries(auth);
       if (IsUserPort(auth->client))
         sendheader(auth->client, REPORT_FAIL_DNS);
@@ -820,21 +826,18 @@
     if (IsUserPort(auth->client))
       sendheader(auth->client, REPORT_FAIL_DNS);
     sendto_iauth(auth->client, "d");
-  } else if (irc_in_addr_cmp(addr, &cli_ip(auth->client))
-             && irc_in_addr_cmp(addr, &auth->original)) {
+  } else if (!irc_in_addr_valid(addr)
+             || (irc_in_addr_cmp(&cli_ip(auth->client), addr)
+                 && irc_in_addr_cmp(&auth->original, addr))) {
     /* IP for hostname did not match client's IP. */
     sendto_opmask_butone(0, SNO_IPMISMATCH, "IP# Mismatch: %s != %s[%s]",
                          cli_sock_ip(auth->client), h_name,
                          ircd_ntoa(addr));
     if (IsUserPort(auth->client))
       sendheader(auth->client, REPORT_IP_MISMATCH);
-    /* Clear DNS pending flag so free_client doesn't ask the resolver
-     * to delete the query that just finished.
-     */
     if (feature_bool(FEAT_KILL_IPMISMATCH)) {
-      IPcheck_disconnect(auth->client);
-      Count_unknowndisconnects(UserStats);
-      free_client(auth->client);
+      exit_client(auth->client, auth->client, &me, "IP mismatch");
+      return;
     }
   } else if (!auth_verify_hostname(h_name, HOSTLEN)) {
     /* Hostname did not look valid. */
@@ -973,9 +976,7 @@
     ++ServerStats->is_abad;
     if (IsUserPort(auth->client))
       sendheader(auth->client, REPORT_FAIL_ID);
-    IPcheck_disconnect(auth->client);
-    Count_unknowndisconnects(UserStats);
-    free_client(auth->client);
+    exit_client(auth->client, auth->client, &me, "Socket local/peer lookup 
failed");
     return;
   }
   auth->port = remote.port;
Index: ircu2.10/ircd/s_err.c
diff -u ircu2.10/ircd/s_err.c:1.74 ircu2.10/ircd/s_err.c:1.75
--- ircu2.10/ircd/s_err.c:1.74  Thu Apr  6 20:27:50 2006
+++ ircu2.10/ircd/s_err.c       Mon Jun 26 17:11:17 2006
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Error handling support.
- * @version $Id: s_err.c,v 1.74 2006/04/07 03:27:50 entrope Exp $
+ * @version $Id: s_err.c,v 1.75 2006/06/27 00:11:17 entrope Exp $
  */
 #include "config.h"
 
@@ -526,7 +526,7 @@
 /* 246 */
   { RPL_STATSTLINE, "%c %s %s", "246" },
 /* 247 */
-  { RPL_STATSGLINE, "%c %s%s%s %Tu :%s", "247" },
+  { RPL_STATSGLINE, "%c %s%s%s %Tu %c :%s", "247" },
 /* 248 */
   { RPL_STATSULINE, "U %s", "248" },
 /* 249 */
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to