From 3497661394b0066b31ce82b7ac5ad0fbf358a0dd Mon Sep 17 00:00:00 2001 From: Mark <> Date: Tue, 17 Feb 2004 22:16:52 +0000 Subject: [PATCH] try to read nick, user, host and realname so these can be configured --- ChangeLog | 4 +++- opsb.c | 26 +++++++++++++++++++++++++- opsb.h | 3 +++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22039ef..2141458 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ Open Proxy Scanning Bot Module for NeoStats Changelog. ============================================================================== * Version 2.2 * 24/01/2004 * Mark (M) - - Fixed init_bot code - now uses services_bot_modes not hard coded ones + - Fixed init_bot code - now uses services_bot_modes not hard coded ones (M) + - We now try to read nick, user, host and realname so these can be configured more + easily (M) * Version 2.1 * 24/01/2004 * Fish (F) - Sync up libopm with blitzed version to fix a Socks 5 bug (F) diff --git a/opsb.c b/opsb.c index d992b0a..f149641 100644 --- a/opsb.c +++ b/opsb.c @@ -685,7 +685,7 @@ static int Online(char **av, int ac) { SET_SEGV_LOCATION(); - if (init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", services_bot_modes, __module_info.module_name) == -1 ) { + if (init_bot(s_opsb, opsb.user, opsb.host, opsb.rname, services_bot_modes, __module_info.module_name) == -1 ) { /* Nick was in use!!!! */ strlcat(s_opsb, "_", MAXNICK); init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", services_bot_modes, __module_info.module_name); @@ -1170,6 +1170,30 @@ void LoadConfig(void) char datapath[512]; exemptinfo *exempts; + if (GetConf((void *) &tmp, CFGSTR, "Nick") < 0) { + strlcpy(s_opsb, "opsb", MAXNICK); + } else { + strlcpy(s_opsb, tmp, MAXNICK); + free(tmp); + } + if (GetConf((void *) &tmp, CFGSTR, "User") < 0) { + strlcpy(opsb.user, "opsb", MAXUSER); + } else { + strlcpy(opsb.user, tmp, MAXUSER); + free(tmp); + } + if (GetConf((void *) &tmp, CFGSTR, "Host") < 0) { + strlcpy(opsb.host, me.name, MAXHOST); + } else { + strlcpy(opsb.host, tmp, MAXHOST); + free(tmp); + } + if (GetConf((void *) &tmp, CFGSTR, "Rname") < 0) { + ircsnprintf(opsb.rname, MAXREALNAME, "Proxy Scanning Bot"); + } else { + strlcpy(opsb.rname, tmp, MAXREALNAME); + free(tmp); + } if (GetConf((void *)&tmp, CFGSTR, "OpmDomain") <= 0) { strlcpy(opsb.opmdomain, "opm.blitzed.org", MAXHOST); } else { diff --git a/opsb.h b/opsb.h index ccfa666..864137d 100644 --- a/opsb.h +++ b/opsb.h @@ -53,6 +53,9 @@ struct scanq { typedef struct scanq scaninfo; struct opsb { + char user[MAXUSER]; + char host[MAXHOST]; + char rname[MAXREALNAME]; char opmdomain[MAXHOST]; int init; char targethost[MAXHOST];