瀏覽代碼

* Port [3904] to 1.2.16 from trunk
* Add 'link_cleartext' to allow disabling ability for bots to link in without encryption



svn: 3905

Bryan Drewery 17 年之前
父節點
當前提交
198a5344bd
共有 5 個文件被更改,包括 17 次插入4 次删除
  1. 1 0
      doc/UPDATES
  2. 5 1
      doc/help.txt
  3. 8 2
      src/dcc.c
  4. 2 0
      src/set.c
  5. 1 1
      src/set.h

+ 1 - 0
doc/UPDATES

@@ -12,6 +12,7 @@
 * Greatly sped up binary startup - lower resource usage for cron checks, etc.
 * checkchannels now displays server. (fixes #420)
 * Added 'jupenick'. Jupenick is preferred over 'nick' but only 'nick' will be rotated with altchars. Ie, nick_, nick-, etc. (fixes #421)
+* Added 'link_cleartext' which allows disabling of cleartext bot linking (needed for upgrades)
 
 1.2.15 - http://wraith.botpack.net/milestone/1.2.15
 * Fix a possible segfault when binaries compiled wrong

+ 5 - 1
doc/help.txt

@@ -1585,7 +1585,11 @@ See also: reload, backup
  
 [B]  $bident-botnick$b   Send botnick instead of shell username on connect (non-ident)
 [B]  $boidentd$b         Make bot try and use oidentd spoofing as BOTNICK.
- 
+
+[B]  $blink_cleartext$b  Allows bots to link without an encryption scheme. This is needed
+                         for allowing older bots to link in. Be sure to never leave this on
+                         unless upgrading or letting an older bot link in to upgrade.
+
 [B]  $bdccauth$b         Boolean (0 or 1). Set to use auth checking on dcc/telnet login.
 [N]  $bop-bots$b         Number of bots to ask every time a oprequest is to be made.
 [N]  $bin-bots$b         Number of bots to ask every time a inrequest is to be made.

+ 8 - 2
src/dcc.c

@@ -973,6 +973,10 @@ dcc_chat_pass(int idx, char *buf, int atr)
         /* verify we have that type and then initiate it */
         if ((i = link_find_by_type(type)) == -1) {
           putlog(LOG_WARN, "*", STR("%s attempted to link with an invalid encryption. (%d)"), dcc[idx].nick, type);
+          if (type == 0 && !link_cleartext) {
+            putlog(LOG_WARN, "*", "This is likely due to %s needing to be upgraded. Enable 'link_cleartext' to allow linking.", dcc[idx].nick);
+            putlog(LOG_WARN, "*", "Be sure to disable 'link_cleartext' after all bots are upgraded.");
+          }
           killsock(dcc[idx].sock);
           lostdcc(idx);
           return;
@@ -1711,9 +1715,11 @@ dcc_telnet_pass(int idx, int atr)
 
       link_hash(idx, rand);
 
-      for (i = 0; enclink[i].name; i++)
+      
+      for (i = 0; enclink[i].name; i++) {
+        if (enclink[i].type == LINK_CLEARTEXT && !link_cleartext) continue;
         simple_snprintf(buf, sizeof(buf), "%s%d ", buf[0] ? buf : "", enclink[i].type);
-
+      }
       dprintf(-dcc[idx].sock, "neg? %s %s\n", rand, buf);
     } else {
       /* Turn off remote telnet echo (send IAC WILL ECHO). */

+ 2 - 0
src/set.c

@@ -35,6 +35,7 @@ bool oidentd;
 bool ident_botnick;
 int dcc_autoaway;
 bool irc_autoaway;
+bool link_cleartext;
 #ifdef NOT_USED
 int badprocess = DET_IGNORE;
 char process_list[1024] = "";
@@ -92,6 +93,7 @@ static variable_t vars[] = {
  VAR("jupenick",	jupenick,		VAR_STRING|VAR_NOHUB|VAR_JUPENICK|VAR_NODEF,  	0, 0, NULL),
  VAR("kill-threshold",	&kill_threshold,	VAR_INT|VAR_NOLOC,				0, 0, "0"),
  VAR("lag-threshold",	&lag_threshold,		VAR_INT|VAR_NOLHUB,				0, 0, "15"),
+ VAR("link_cleartext",	&link_cleartext,	VAR_INT|VAR_NOLOC|VAR_BOOL,			0, 1, "0"),
  VAR("login",		&login,			VAR_INT|VAR_DETECTED,				0, 4, "warn"),
  VAR("manop-warn",	&manop_warn,		VAR_INT|VAR_BOOL|VAR_NOLHUB,			0, 1, "1"),
  VAR("motd",		motd,			VAR_STRING|VAR_HIDE|VAR_NOLOC,			0, 0, NULL),

+ 1 - 1
src/set.h

@@ -68,7 +68,7 @@ typedef struct rate_b {
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],
 			msgident[], msginvite[], msgop[], msgpass[],
                         homechan[], altchars[];
-extern bool		dccauth, auth_obscure, manop_warn, auth_chan, oidentd, ident_botnick, irc_autoaway;
+extern bool		dccauth, auth_obscure, manop_warn, auth_chan, oidentd, ident_botnick, irc_autoaway, link_cleartext;
 extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare, dcc_autoaway,
 			kill_threshold, lag_threshold, op_bots, hijack, login, promisc, trace,
                         ison_time;