Bladeren bron

* Fixed a bug in the hash creation of cookies due to an ircd stripping excess '*' in cookies.

svn: 2096
Bryan Drewery 21 jaren geleden
bovenliggende
commit
3be5f97bdc
3 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. 1 1
      doc/UPDATES
  2. 1 0
      src/eggdrop.h
  3. 5 0
      src/misc.c

+ 1 - 1
doc/UPDATES

@@ -122,7 +122,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Fixed a bug where a bot would stop trying to connect to servers if using ipv6.
 * New channels get a default chanset of: flood-ctcp 5:30
 * Tempdir is now chosen from a list as follows: (hub) ./tmp/ (leaf) ~/.ssh/..., /tmp/, /usr/tmp/, /var/tmp/, ./
-
+* Fixed a bug in the hash creation of cookies due to an ircd stripping excess '*' in cookies.
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 1 - 0
src/eggdrop.h

@@ -54,6 +54,7 @@
 #define NOTENAMELEN     ((HANDLEN << 1) + 1)
 #define BADPASSCHARS    "-+"
 #define LISTSEPERATORS  ",=:; "
+#define BADREPEATEDRAND "*?"
 
 
 #if (NICKMAX < 9) || (NICKMAX > 32)

+ 5 - 0
src/misc.c

@@ -437,6 +437,11 @@ void make_rand_str(char *s, size_t len)
 
     if (s[j] == 33 || s[j] == 37 || s[j] == 34 || s[j] == 40 || s[j] == 41 || s[j] == 38 || s[j] == 36) /* no % ( ) & */
       s[j] = 'a' + randint(26);
+
+    if (j && strchr(BADREPEATEDRAND, s[j]) && s[j] == s[j - 1]) {
+      while (s[j] == s[j - 1])
+          s[j] = 'A' + randint(26);
+    }
   }
 
   if (strchr(BADPASSCHARS, s[0]))