Kaynağa Gözat

* Was forgetting to clear/reset the auth[].user list in share.mod :)

svn: 1022
Bryan Drewery 22 yıl önce
ebeveyn
işleme
25fb254c20
2 değiştirilmiş dosya ile 12 ekleme ve 2 silme
  1. 1 0
      doc/UPDATES
  2. 11 2
      src/mod/share.mod/share.c

+ 1 - 0
doc/UPDATES

@@ -14,6 +14,7 @@ This is a summary of ChangeLog basically.
 10.+private checking was segfaulting some cmds under certain conditions.
 10.+private checking was segfaulting some cmds under certain conditions.
 11.Leaf bots weren't sharing partyline members on link.
 11.Leaf bots weren't sharing partyline members on link.
 12.cfg: cmdprefix is now working as intended.
 12.cfg: cmdprefix is now working as intended.
+13.Fixed a very obscure bug in auth/share that would corrupt the memory.
 
 
 1.1.7
 1.1.7
 
 

+ 11 - 2
src/mod/share.mod/share.c

@@ -14,6 +14,7 @@
 #include "src/users.h"
 #include "src/users.h"
 #include "src/userrec.h"
 #include "src/userrec.h"
 #include "src/botnet.h"
 #include "src/botnet.h"
+#include "src/auth.h"
 
 
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
@@ -1334,6 +1335,8 @@ finish_share(int idx)
    */
    */
   for (i = 0; i < dcc_total; i++)
   for (i = 0; i < dcc_total; i++)
     dcc[i].user = NULL;
     dcc[i].user = NULL;
+  for (i = 0; i < auth_total; i++)
+    auth[i].user = NULL;
 
 
   if (conf.bot->u)
   if (conf.bot->u)
     conf.bot->u = NULL;
     conf.bot->u = NULL;
@@ -1355,6 +1358,9 @@ finish_share(int idx)
                                  * channel lists.                       */
                                  * channel lists.                       */
     for (i = 0; i < dcc_total; i++)
     for (i = 0; i < dcc_total; i++)
       dcc[i].user = get_user_by_handle(ou, dcc[i].nick);
       dcc[i].user = get_user_by_handle(ou, dcc[i].nick);
+    for (i = 0; i < auth_total; i++)
+      if (auth[i].hand[0])
+        auth[i].user = get_user_by_handle(ou, auth[i].hand);
 
 
     conf.bot->u = get_user_by_handle(ou, conf.bot->nick);
     conf.bot->u = get_user_by_handle(ou, conf.bot->nick);
 
 
@@ -1379,10 +1385,10 @@ finish_share(int idx)
 
 
   /* SUCCESS! */
   /* SUCCESS! */
 
 
+
   unlink(dcc[idx].u.xfer->filename);
   unlink(dcc[idx].u.xfer->filename);
 
 
   loading = 0;
   loading = 0;
-
   clear_chanlist();             /* Remove all user references from the
   clear_chanlist();             /* Remove all user references from the
                                  * channel lists.                       */
                                  * channel lists.                       */
   userlist = u;                 /* Set new user list.                   */
   userlist = u;                 /* Set new user list.                   */
@@ -1395,7 +1401,10 @@ finish_share(int idx)
    */
    */
   clear_userlist(ou);
   clear_userlist(ou);
 
 
-  unlink(dcc[idx].u.xfer->filename);    /* Done with you!               */
+  /* copy over any auth users */
+  for (i = 0; i < auth_total; i++)
+    if (auth[i].hand[0])
+      auth[i].user = get_user_by_handle(userlist, auth[i].hand);
 
 
   checkchans(1);                /* remove marked channels */
   checkchans(1);                /* remove marked channels */
   trigger_cfg_changed();
   trigger_cfg_changed();