Sfoglia il codice sorgente

* Fixed bot username casing causing bad cookies.

svn: 2255
Bryan Drewery 21 anni fa
parent
commit
af97e3d5aa
2 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 1 0
      doc/UPDATES
  2. 2 1
      src/mod/irc.mod/irc.c

+ 1 - 0
doc/UPDATES

@@ -15,6 +15,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed spaces being stripped in .botcmd reply.
 * Changed order of 'rehashed config data from binary' notice to appear before any bot/userfile changes.
 * 'localhub's now check minutely if their bots need added or hosts added to userlist.
+* Fixed bot username casing causing bad cookies.
 
 1.2.4
 * Fixed cmd_botset not displaying botnick.

+ 2 - 1
src/mod/irc.mod/irc.c

@@ -282,7 +282,7 @@ makecookie(char *chn, char *bnick)
   if (strlen(chname) > 2)
     chname[3] = 0;
   strtoupper(chname);
-
+  strtolower(bnick);
   simple_sprintf(tohash, "%c%s%s%s%s%c", settings.salt2[0], bnick, chname, &ts[4], randstring, settings.salt2[15]);
   hash = MD5(tohash);
   buf = (char *) my_calloc(1, 20);
@@ -312,6 +312,7 @@ checkcookie(char *chn, char *bnick, char *cookie)
     chname[3] = 0;
   strtoupper(chname);
   /* hash!rand@ts */
+  strtolower(bnick);
   simple_sprintf(tohash, "%c%s%s%s%s%c", settings.salt2[0], bnick, chname, &ts[4], randstring, settings.salt2[15]);
   hash = MD5(tohash);
   if (!(hash[8] == cookie[0] && hash[16] == cookie[1] && hash[18] == cookie[2]))