Просмотр исходного кода

* Booting a su'd user now returns the user to their original connection. (Problem when removing +i)

svn: 2337
Bryan Drewery 21 лет назад
Родитель
Сommit
4a4caa7715
2 измененных файлов с 15 добавлено и 1 удалено
  1. 1 0
      doc/UPDATES
  2. 14 1
      src/dccutil.c

+ 1 - 0
doc/UPDATES

@@ -14,6 +14,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 1.2.7
 1.2.7
 * Forgot 'log_bad = 0;' to fix the '!' showing up for aliases.
 * Forgot 'log_bad = 0;' to fix the '!' showing up for aliases.
 * When a user is removed and is on partyline, they are now booted. (#142)
 * When a user is removed and is on partyline, they are now booted. (#142)
+* Booting a su'd user now returns the user to their original connection. (Problem when removing +i)
 
 
 1.2.6
 1.2.6
 * (REVERTED FROM 1.2.3) Disabled all memory allocations after a segfault (Fixes CPU spinning)
 * (REVERTED FROM 1.2.3) Disabled all memory allocations after a segfault (Fixes CPU spinning)

+ 14 - 1
src/dccutil.c

@@ -802,7 +802,20 @@ do_boot(int idx, char *by, char *reason)
       botnet_send_part_idx(idx, x);
       botnet_send_part_idx(idx, x);
   }
   }
   check_bind_chof(dcc[idx].nick, idx);
   check_bind_chof(dcc[idx].nick, idx);
-  if ((dcc[idx].sock != STDOUT) || backgrd) {
+
+  if (dcc[idx].u.chat->su_nick) {
+    dcc[idx].user = get_user_by_handle(userlist, dcc[idx].u.chat->su_nick);
+    strcpy(dcc[idx].nick, dcc[idx].u.chat->su_nick);
+    dcc[idx].type = &DCC_CHAT;
+    dprintf(idx, "Returning to real nick %s!\n", dcc[idx].u.chat->su_nick);
+    free(dcc[idx].u.chat->su_nick);
+    dcc[idx].u.chat->su_nick = NULL;
+    dcc_chatter(idx);
+
+    if (dcc[idx].u.chat->channel < GLOBAL_CHANS && dcc[idx].u.chat->channel >= 0) {
+      botnet_send_join_idx(idx);
+    }
+  } else if ((dcc[idx].sock != STDOUT) || backgrd) {
     killsock(dcc[idx].sock);
     killsock(dcc[idx].sock);
     lostdcc(idx);
     lostdcc(idx);
     /* Entry must remain in the table so it can be logged by the caller */
     /* Entry must remain in the table so it can be logged by the caller */