[cvslog] [CVS] Module eggdrop1.6: Change committed

cvs at eggheads.org cvs at eggheads.org
Sun Jan 10 16:29:07 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2010-01-10 22:29:07 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     eggdrop.conf doc/Changes1.6 doc/html/egg-core.html
     doc/html/mod-server.html doc/settings/core.settings
     doc/settings/mod.server help/set/cmds1.help src/patch.h
     src/userrec.c src/mod/server.mod/help/set/server.help

Log message:

Moved strict-host documentation to the core section, where it belongs and added a warning to discourage it's usage in the future.

Rewrote fixfrom() to not modify it's string argument.
Fixes Bugzilla Bug # 423 "Enforcement of Non-matching Bans"
Found by: BarkerJr / Patch by: pseudo

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/Changes1.6
diff -u eggdrop1.6/doc/Changes1.6:1.55 eggdrop1.6/doc/Changes1.6:1.56
--- eggdrop1.6/doc/Changes1.6:1.55	Thu Jan  7 07:48:30 2010
+++ eggdrop1.6/doc/Changes1.6	Sun Jan 10 16:28:56 2010
@@ -1,4 +1,4 @@
-$Id: Changes1.6,v 1.55 2010/01/07 13:48:30 pseudo Exp $
+$Id: Changes1.6,v 1.56 2010/01/10 22:28:56 pseudo Exp $
 
 Eggdrop Changes (since version 1.6.0)
 
@@ -6,6 +6,12 @@
 
 1.6.20 (CVS):
 
+  - Moved strict-host documentation to the core section, where it belongs and
+    added a warning to discourage it's usage in the future.
+  - Rewrote fixfrom() to not modify it's string argument.
+    Fixes Bugzilla Bug # 423 "Enforcement of Non-matching Bans"
+    Found by: BarkerJr / Patch by: pseudo
+
   - Added CIDR support to eggdrop. This includes accepting and matching b/e/I
     masks and user hosts in cidr notation.
   - Moved rfc_toupper from wild_match() to the new addr_match().
Index: eggdrop1.6/doc/html/egg-core.html
diff -u eggdrop1.6/doc/html/egg-core.html:1.46 eggdrop1.6/doc/html/egg-core.html:1.47
--- eggdrop1.6/doc/html/egg-core.html:1.46	Thu Jan  7 07:48:30 2010
+++ eggdrop1.6/doc/html/egg-core.html	Sun Jan 10 16:28:57 2010
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: egg-core.html,v 1.46 2010/01/07 13:48:30 pseudo Exp $ -->
+<!-- $Id: egg-core.html,v 1.47 2010/01/10 22:28:57 pseudo Exp $ -->
 
 <html>
   <head>
@@ -846,6 +846,16 @@
           then finally reject the bot.</p>
         </dd>
         
+        <dt><strong>set strict-host 1</strong></dt>
+
+        <dd>
+          <p>Set this to 0 if you want the bot to strip &#39;~+-^=&#39;
+          characters from user at hosts before matching them. This setting is
+          currently kept for compatibility, but will be removed from the next
+          release. Please leave it set to 1 for now to avoid problems with your
+          user files in the future.</p>
+        </dd>
+
         <dt><strong>set cidr-support 0</strong></dt>
         
         <dd>
Index: eggdrop1.6/doc/html/mod-server.html
diff -u eggdrop1.6/doc/html/mod-server.html:1.40 eggdrop1.6/doc/html/mod-server.html:1.41
--- eggdrop1.6/doc/html/mod-server.html:1.40	Sun Jan  3 07:27:23 2010
+++ eggdrop1.6/doc/html/mod-server.html	Sun Jan 10 16:28:57 2010
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: mod-server.html,v 1.40 2010/01/03 13:27:23 pseudo Exp $ -->
+<!-- $Id: mod-server.html,v 1.41 2010/01/10 22:28:57 pseudo Exp $ -->
 
 <html>
   <head>
@@ -235,13 +235,6 @@
           users only. Please choose your owners with care.</p>
         </dd>
 
-        <dt><strong>set strict-host 0</strong></dt>
-
-        <dd>
-          <p>Set this to 0 if you want the bot to strip &#39;~&#39; characters
-          from user at hosts before matching them.</p>
-        </dd>
-
         <dt><strong>set quiet-reject 1</strong></dt>
 
         <dd>
Index: eggdrop1.6/doc/settings/core.settings
diff -u eggdrop1.6/doc/settings/core.settings:1.40 eggdrop1.6/doc/settings/core.settings:1.41
--- eggdrop1.6/doc/settings/core.settings:1.40	Thu Jan  7 07:48:30 2010
+++ eggdrop1.6/doc/settings/core.settings	Sun Jan 10 16:28:57 2010
@@ -1,4 +1,4 @@
-$Id: core.settings,v 1.40 2010/01/07 13:48:30 pseudo Exp $
+$Id: core.settings,v 1.41 2010/01/10 22:28:57 pseudo Exp $
 
 Eggdrop Core Settings
 Last revised: April 17, 2003
@@ -494,6 +494,13 @@
       reject the bot.
 
 
+    set strict-host 1
+      Set this to 0 if you want the bot to strip '~+-^=' characters from
+      user at hosts before matching them. This setting is currently kept for
+      compatibility, but will be removed from the next release. Please leave
+      it set to 1 for now to avoid problems with your user files in the future.
+
+
     set cidr-support 0
       Enables cidr support for b/e/I modes if set to 1. This means the bot
       will understand and match modes in cidr notation, and will be able to
Index: eggdrop1.6/doc/settings/mod.server
diff -u eggdrop1.6/doc/settings/mod.server:1.40 eggdrop1.6/doc/settings/mod.server:1.41
--- eggdrop1.6/doc/settings/mod.server:1.40	Sun Jan  3 07:27:23 2010
+++ eggdrop1.6/doc/settings/mod.server	Sun Jan 10 16:28:57 2010
@@ -1,4 +1,4 @@
-$Id: mod.server,v 1.40 2010/01/03 13:27:23 pseudo Exp $
+$Id: mod.server,v 1.41 2010/01/10 22:28:57 pseudo Exp $
 
 Server Module
 Last revised: February 12, 2003
@@ -139,11 +139,6 @@
       want to raise this. 300 is fine for most people though.
 
 
-    set strict-host 0
-      Set this to 0 if you want the bot to strip '~' characters from user at hosts
-      before matching them.
-
-
     set quiet-reject 1
       This setting makes the bot squelch the error message when rejecting a
       DCC CHAT, SEND or message command. Normally, Eggdrop notifies the user
@@ -155,6 +150,7 @@
       Set here how many msgs in how many seconds from one host constitutes
       a flood. If you set this to 0:0, msg flood protection will be disabled.
 
+
     set flood-ctcp 3:60
       Set here how many ctcps in how many seconds from one host are
       recognized as a flood. Not specifying or using number = 0
@@ -193,6 +189,7 @@
     set double-help 0
       Allow identical messages in the help queue?
 
+
     set use-penalties 1 (default on net-type 1)
       This enables Eggdrop's penalty calculation. Every command Eggdrop sends
       to the IRC server raises its penalty points. If Eggdrop reaches a server
Index: eggdrop1.6/eggdrop.conf
diff -u eggdrop1.6/eggdrop.conf:1.59 eggdrop1.6/eggdrop.conf:1.60
--- eggdrop1.6/eggdrop.conf:1.59	Thu Jan  7 07:48:30 2010
+++ eggdrop1.6/eggdrop.conf	Sun Jan 10 16:28:56 2010
@@ -1,7 +1,7 @@
 #! /path/to/executable/eggdrop
 # ^- This should contain a fully qualified path to your Eggdrop executable.
 #
-# $Id: eggdrop.conf,v 1.59 2010/01/07 13:48:30 pseudo Exp $
+# $Id: eggdrop.conf,v 1.60 2010/01/10 22:28:56 pseudo Exp $
 #
 # This is a sample Eggdrop configuration file which includes all possible
 # settings that can be used to configure your bot.
@@ -400,6 +400,13 @@
 # seconds before it checks again and then finally reject the bot.
 set dupwait-timeout 5
 
+# Set this to 0 if you want the bot to strip '~+-^=' characters from user at hosts
+# before matching them.
+# This setting is currently kept for compatibility, but will be removed from
+# the next release. Please leave it set to 1 to avoid problems with your user
+# files in the future.
+set strict-host 1
+
 # Enable cidr support for b/e/I modes. This means the bot will understand
 # and match modes in cidr notation, and will be able to put and enforce such
 # bans or unban itself, if banned with a cidr mask.
@@ -866,9 +873,6 @@
 # primary nickname is already in use.
 set keep-nick 1
 
-# Set this to 0 if you want the bot to strip '~' characters from user at hosts
-# before matching them.
-set strict-host 0
 
 # This setting makes the bot squelch the error message when rejecting a DCC
 # CHAT, SEND or message command. Normally, Eggdrop notifies the user that the
Index: eggdrop1.6/help/set/cmds1.help
diff -u eggdrop1.6/help/set/cmds1.help:1.12 eggdrop1.6/help/set/cmds1.help:1.13
--- eggdrop1.6/help/set/cmds1.help:1.12	Thu Jan  7 07:48:31 2010
+++ eggdrop1.6/help/set/cmds1.help	Sun Jan 10 16:28:57 2010
@@ -235,6 +235,14 @@
 ###  %bset share-unlinks%b 0/1
    This setting prohibits remote bots from telling your Eggdrop to
    unlink from share bots.
+%{help=set strict-host}%{+n}
+###  %bset strict-host%b <0/1>
+   Specifies whether the bot should leave leading ~+-^= in users'
+   hostnames. If this is on, the bot will differentiate between
+   valid-ident usernames and invalid ones. This setting is currently
+   kept for compatibility, but will be removed from the next release.
+   Please leave it set to 1 for now to avoid problems with your user
+   files in the future.
 %{help=set cidr-support}%{+n}
 ###  %bset cidr-support%b <0/1>
    Enables cidr support for b/e/I modes if set to 1. This means the
Index: eggdrop1.6/src/mod/server.mod/help/set/server.help
diff -u eggdrop1.6/src/mod/server.mod/help/set/server.help:1.11 eggdrop1.6/src/mod/server.mod/help/set/server.help:1.12
--- eggdrop1.6/src/mod/server.mod/help/set/server.help:1.11	Thu Oct  1 09:52:34 2009
+++ eggdrop1.6/src/mod/server.mod/help/set/server.help	Sun Jan 10 16:28:57 2010
@@ -45,14 +45,6 @@
    This read-only variables returns the unix-time that the bot
    successfully connected to the server, so if you can read unix
    time, you'll be in luck ;)
-%{help=set strict-host}%{+n}
-###  %bset strict-host%b <0/1>
-   specifies whether the bot should leave leading ~ in users' host-
-   names.  if this is on, leading ~ will be left in (the bot will
-   differentiate between valid-ident usernames and invalid ones).
-   typically this is set off, since most sites are not running the
-   ident protocol, and therefore may get ~ put in front of their
-   username when their username is valid.
 %{help=set never-give-up}%{+n}
 ###  %bset never-give-up%b <0/1>
    specifies whether the bot should loop forever.  if never-give-up
@@ -185,10 +177,10 @@
    %b'.help server module'%b.
      %bserver-online%b        %bservlimit%b      %bnick%b
      %bnever-give-up%b        %bflood-ctcp%b     %bserver%b
-     %bmax-queue-msg%b        %bstrict-host%b    %bbotnick%b
+     %bmax-queue-msg%b        %bmsg-rate%b       %bbotnick%b
      %bserver-timeout%b       %binit-server%b    %bservers%b
      %blowercase-ctcp%b       %bnet-type%b       %bbotname%b
      %bserverror-quit%b       %banswer-ctcp%b    %baltnick%b
      %btrigger-on-ignore%b    %bdefault-port%b   %brealname%b
      %bserver-cycle-wait%b    %bcheck-stoned%b   %bflood-msg%b
-     %bquiet-reject%b         %bkeep-nick%b      %bmsg-rate
+     %bquiet-reject%b         %bkeep-nick%b
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1227 eggdrop1.6/src/patch.h:1.1228
--- eggdrop1.6/src/patch.h:1.1227	Thu Jan  7 07:48:31 2010
+++ eggdrop1.6/src/patch.h	Sun Jan 10 16:28:57 2010
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1227 2010/01/07 13:48:31 pseudo Exp $
+ * $Id: patch.h,v 1.1228 2010/01/10 22:28:57 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1262871604");            /* current unixtime */
+patch("1263162488");            /* current unixtime */
 /*
  *
  *
  */
-patch("cidr");
+patch("fixfrom");
 /*
  *
  *
Index: eggdrop1.6/src/userrec.c
diff -u eggdrop1.6/src/userrec.c:1.60 eggdrop1.6/src/userrec.c:1.61
--- eggdrop1.6/src/userrec.c:1.60	Thu Jan  7 07:48:31 2010
+++ eggdrop1.6/src/userrec.c	Sun Jan 10 16:28:57 2010
@@ -4,7 +4,7 @@
  *   a bunch of functions to find and change user records
  *   change and check user (and channel-specific) flags
  *
- * $Id: userrec.c,v 1.60 2010/01/07 13:48:31 pseudo Exp $
+ * $Id: userrec.c,v 1.61 2010/01/10 22:28:57 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -45,7 +45,7 @@
 maskrec *global_bans = NULL, *global_exempts = NULL, *global_invites = NULL;
 struct igrec *global_ign = NULL;
 int cache_hit = 0, cache_miss = 0; /* temporary cache accounting    */
-int strict_host = 0;
+int strict_host = 1;
 int userfile_perm = 0600;         /* Userfile permissions
                                    * (default rw-------) */
 
@@ -168,21 +168,22 @@
  */
 char *fixfrom(char *s)
 {
-  char *p = NULL;
+  static char uhost[UHOSTLEN];
+  char *p = uhost;
 
   if (!s || !*s || strict_host)
     return s;
 
-  if ((p = strchr(s, '!'))) {
-    if (!*(++p))
-      return s;	/* There's nothing following "!". */
-  } else
-    p = s; /* There's no nick. */
-
-  if (strchr("~+-^=", *p) && *(p + 1) != '@')
-    memmove(p, p + 1, strlen(p)); /* NUL is included without +1. */
+  while (*s) {
+    *p++ = *s;
+    if (*s == '!' && strchr("~+-^=", s[1]) && s[2] != '@') {
+      strcpy(p, s + 2);
+      break;
+    }
+    s++;
+  }
 
-  return s;
+  return uhost;
 }
 
 struct userrec *check_dcclist_hand(char *handle)
@@ -323,7 +324,7 @@
   }
   cache_miss++;
   strncpyz(host2, host, sizeof host2);
-  fixfrom(host);
+  host = fixfrom(host);
   for (u = userlist; u; u = u->next) {
     q = get_user(&USERENTRY_HOSTS, u);
     for (; q; q = q->next) {
@@ -657,7 +658,7 @@
      *   but its much easier to use here...  (drummer)
      *   Only use it if we have a host :) (dw)
      */
-    fixfrom(host);
+    host = fixfrom(host);
 
     p = strchr(host, ',');
     while (p != NULL) {
----------------------- End of diff -----------------------


More information about the Changes mailing list