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

* Port [3504] to 1.2.14
* Added oidentd support. set 'oidentd' on makes bot spoof as BOTNICK.



svn: 3505

Bryan Drewery 19 лет назад
Родитель
Сommit
8d63019531
5 измененных файлов с 19 добавлено и 2 удалено
  1. 1 0
      doc/UPDATES
  2. 2 0
      misc/help.txt
  3. 12 0
      src/dccutil.c
  4. 3 1
      src/set.c
  5. 1 1
      src/set.h

+ 1 - 0
doc/UPDATES

@@ -56,6 +56,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * -host now accepts partial host masks, ie, '-host user@host'.
 * Rewrote cmd_mdop into cmd_mmode. See 'help mmode' on a leaf bot.
 * Fixed bots having problems with kick/bans on undernet.
+* Added oidentd support. set 'oidentd' on makes bot spoof as BOTNICK.
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 2 - 0
misc/help.txt

@@ -1557,6 +1557,8 @@ See also: reload, backup
 [S]  $busermode$b        The bot's usermode on IRC. (Set on connect/rehash)
 [S]  $bnick$b            The bot's preferred nickname on IRC.
 [N]  $bnotify-time$b     The number of seconds between server notify checks for nick.
+
+[B]  $boidentd$b         Make bot try and use oidentd spoofing as BOTNICK.
  
 [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.

+ 12 - 0
src/dccutil.c

@@ -957,6 +957,18 @@ identd_open()
     } else
       killsock(i);
   }
+
+  if (conf.homedir && oidentd) {
+    char oidentd_conf[1024] = "";
+
+    simple_snprintf(oidentd_conf, sizeof(oidentd_conf), "%s/.oidentd.conf", conf.homedir);
+
+    FILE *f = fopen(oidentd_conf, "w");
+    if (f) {
+      fprintf(f, "global { reply \"%s\" }\n", conf.bot->nick);
+      fclose(f);
+    }
+  }
 }
 
 void

+ 3 - 1
src/set.c

@@ -26,13 +26,14 @@ bool auth_chan;
 char auth_key[51] = "";
 char auth_prefix[2] = "";
 bool auth_obscure;
+bool oidentd;
+int dcc_autoaway;
 #ifdef NOT_USED
 int badprocess = DET_IGNORE;
 char process_list[1024] = "";
 #endif
 bool dccauth = 0;
 char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop";
-int dcc_autoaway;
 int cloak_script = 0;
 rate_t close_threshold;
 int fight_threshold;
@@ -92,6 +93,7 @@ static variable_t vars[] = {
  VAR("msg-op",		msgop,			VAR_STRING|VAR_NOLHUB,				0, 0, NULL),
  VAR("msg-pass",	msgpass,		VAR_STRING|VAR_NOLHUB,				0, 0, NULL),
  VAR("nick",		origbotname,		VAR_STRING|VAR_NOLHUB|VAR_NICK|VAR_NODEF|VAR_NOGHUB,	0, 0, NULL),
+ VAR("oidentd",		&oidentd,		VAR_INT|VAR_BOOL|VAR_NOLHUB,			0, 1, "0"),
  VAR("op-bots",		&op_bots,		VAR_INT|VAR_NOLOC,				1, MAX_BOTS, "1"),
  VAR("op-requests",	&op_requests,		VAR_RATE|VAR_NOLOC,				0, 0, "2:5"),
 #ifdef NOT_USED

+ 1 - 1
src/set.h

@@ -65,7 +65,7 @@ typedef struct rate_b {
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],
 			msgident[], msginvite[], msgop[], msgpass[],
                         homechan[];
-extern bool		dccauth, auth_obscure, offensive_bans, manop_warn, auth_chan;
+extern bool		dccauth, auth_obscure, offensive_bans, manop_warn, auth_chan, oidentd;
 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;