瀏覽代碼

Merge branch 'auth-lookup' into maint

* auth-lookup:
  * Fix auth IRC lookups getting the wrong cached idx
Bryan Drewery 16 年之前
父節點
當前提交
6a6ce0d4c5
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 1 0
      doc/UPDATES
  2. 4 0
      src/auth.c

+ 1 - 0
doc/UPDATES

@@ -10,6 +10,7 @@
 * Fix buffer overflow in DCC
 * Fix buffer overflow in DCC
 * Fix problems with changing IP
 * Fix problems with changing IP
 * Fix bot going zombie if it jumps during a restart
 * Fix bot going zombie if it jumps during a restart
+* Fix auth IRC lookups getting the wrong cached idx
 
 
 1.3 - http://wraith.botpack.net/milestone/1.3
 1.3 - http://wraith.botpack.net/milestone/1.3
 * Binary / shell / startup changes
 * Binary / shell / startup changes

+ 4 - 0
src/auth.c

@@ -183,6 +183,10 @@ sdprintf(STR("GETIDX: auth: %s, idx: %d"), nick, idx);
   if (idx != -1) {
   if (idx != -1) {
     if (!valid_idx(idx))
     if (!valid_idx(idx))
       idx = -1;
       idx = -1;
+    else if (!dcc[idx].irc || dcc[idx].simul == -1)
+      idx = -1;
+    else if (strcmp(dcc[idx].nick, handle))
+      idx = -1;
     else {
     else {
       sdprintf(STR("FIRST FOUND: %d"), idx);
       sdprintf(STR("FIRST FOUND: %d"), idx);
       strlcpy(dcc[idx].simulbot, nick, sizeof(dcc[idx].simulbot));
       strlcpy(dcc[idx].simulbot, nick, sizeof(dcc[idx].simulbot));