diff --git a/ChangeLog b/ChangeLog index 23e97a76..5cb6473d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ Anything we add/remove/fix/change is in here (even our rants) Fish (F), Mark (M), DeadNotBuried (D) =============================================================================== * NeoStats * Version 3.0.a3-dev + - Replace SET VERSIONSCAN option with automatic support based on module + flags. (M) - Fix OSX changes which prevent NeoStats running any any platform. (M) - Fix a potential security vulnerbility with user supplied strings (F) - NeoStats now compiles and runs on Mac OSX (Tiger) (F) diff --git a/include/helpstrings.h b/include/helpstrings.h index 841a1311..c2413772 100644 --- a/include/helpstrings.h +++ b/include/helpstrings.h @@ -56,7 +56,6 @@ extern const char *ns_help_set_splittime[]; extern const char *ns_help_set_msgsampletime[]; extern const char *ns_help_set_msgthreshold[]; extern const char *ns_help_set_pingtime[]; -extern const char *ns_help_set_versionscan[]; extern const char *ns_help_set_servicecmode[]; extern const char *ns_help_set_serviceumode[]; extern const char *ns_help_set_loglevel[]; diff --git a/modules/statserv/statserv.c b/modules/statserv/statserv.c index f6a0ce02..2eeeb5fe 100644 --- a/modules/statserv/statserv.c +++ b/modules/statserv/statserv.c @@ -88,7 +88,7 @@ ModuleInfo module_info = { CORE_MODULE_VERSION, __DATE__, __TIME__, - 0, + MODULE_FLAG_CTCP_VERSION, 0, }; diff --git a/neostats.sln b/neostats.sln index 0fc8208c..022b179b 100644 --- a/neostats.sln +++ b/neostats.sln @@ -1,8 +1,4 @@ Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "neostats", "src\neostats.vcproj", "{02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "connectserv", "modules\connectserv\connectserv.vcproj", "{E033ECCE-E55E-43BC-89E7-ABE8AA46CE1F}" ProjectSection(ProjectDependencies) = postProject {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3} = {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3} @@ -119,6 +115,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "limitserv", "modules\limits ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "neostats", "src\neostats.vcproj", "{02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -127,14 +127,6 @@ Global Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution - {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Debug.ActiveCfg = Debug|Win32 - {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Debug.Build.0 = Debug|Win32 - {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Perl-Debug.ActiveCfg = Perl-Debug|Win32 - {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Perl-Debug.Build.0 = Perl-Debug|Win32 - {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Perl-Release.ActiveCfg = Perl-Release|Win32 - {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Perl-Release.Build.0 = Perl-Release|Win32 - {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Release.ActiveCfg = Release|Win32 - {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Release.Build.0 = Release|Win32 {E033ECCE-E55E-43BC-89E7-ABE8AA46CE1F}.Debug.ActiveCfg = Debug|Win32 {E033ECCE-E55E-43BC-89E7-ABE8AA46CE1F}.Debug.Build.0 = Debug|Win32 {E033ECCE-E55E-43BC-89E7-ABE8AA46CE1F}.Perl-Debug.ActiveCfg = Perl-Debug|Win32 @@ -343,6 +335,14 @@ Global {5E3A1DF8-46AF-485A-BAB2-3DC78C922F8F}.Perl-Release.Build.0 = Perl-Release|Win32 {5E3A1DF8-46AF-485A-BAB2-3DC78C922F8F}.Release.ActiveCfg = Release|Win32 {5E3A1DF8-46AF-485A-BAB2-3DC78C922F8F}.Release.Build.0 = Release|Win32 + {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Debug.ActiveCfg = Debug|Win32 + {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Debug.Build.0 = Debug|Win32 + {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Perl-Debug.ActiveCfg = Perl-Debug|Win32 + {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Perl-Debug.Build.0 = Perl-Debug|Win32 + {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Perl-Release.ActiveCfg = Perl-Release|Win32 + {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Perl-Release.Build.0 = Perl-Release|Win32 + {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Release.ActiveCfg = Release|Win32 + {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff --git a/src/confuse.c b/src/confuse.c index b2c3e126..5245259c 100644 --- a/src/confuse.c +++ b/src/confuse.c @@ -968,14 +968,17 @@ int cfg_parse_fp(cfg_t *cfg, FILE *fp) int cfg_parse(cfg_t *cfg, const char *filename) { - int ret; + char pszDir[255]; + int ret; FILE *fp; nassert(cfg && filename); free(cfg->filename); cfg->filename = cfg_tilde_expand(filename); - fp = fopen(cfg->filename, "rt"); + getcwd( pszDir, 255 ); + + fp = fopen(cfg->filename, "rt"); if(fp == 0) return CFG_FILE_ERROR; ret = cfg_parse_fp(cfg, fp); diff --git a/src/helpstrings.c b/src/helpstrings.c index 6ee8914b..761bbc6b 100644 --- a/src/helpstrings.c +++ b/src/helpstrings.c @@ -341,12 +341,6 @@ const char *ns_help_set_realname[] = { NULL }; -const char *ns_help_set_versionscan[] = { - "\2VERSIONSCAN \2", - "CTCP version users on connection to the network.", - NULL -}; - const char *ns_help_set_servicecmode[] = { "\2SERVICECMODE \2", "Channel modes assigned to service bots when they join", diff --git a/src/modules.c b/src/modules.c index 3f5a80b8..1afae374 100644 --- a/src/modules.c +++ b/src/modules.c @@ -333,9 +333,10 @@ static Module *load_stdmodule( const char *modfilename, Client * u ) } /* Module side user authentication for e.g. SecureServ helpers * Not available on auth modules */ - if( !( infoptr->flags & MODULE_FLAG_AUTH ) ) { + if( !( infoptr->flags & MODULE_FLAG_AUTH ) ) mod_ptr->authcb = ns_dlsym( ( int * ) handle, "ModAuthUser" ); - } + if( infoptr->flags & MODULE_FLAG_CTCP_VERSION ) + me.versionscan ++; /* assign a module number to this module */ assign_mod_number( mod_ptr ); @@ -559,9 +560,9 @@ int unload_module( const char *modname, Client * u ) #endif /* USE_PERL */ if( mod_ptr->info->flags & MODULE_FLAG_AUTH ) - { DelAuthModule( mod_ptr ); - } + if( mod_ptr->info->flags & MODULE_FLAG_CTCP_VERSION ) + me.versionscan --; moduleindex = mod_ptr->modnum; /* canx any DNS queries used by this module */ canx_dns( mod_ptr ); diff --git a/src/services.c b/src/services.c index a413244d..b4dc582e 100644 --- a/src/services.c +++ b/src/services.c @@ -124,7 +124,6 @@ static bot_setting ns_settings[] = {"SPLITTIME", &nsconfig.splittime, SET_TYPE_INT, 0, 1000, NS_ULEVEL_ADMIN, NULL, ns_help_set_splittime, NULL,( void * )300 }, {"JOINSERVICESCHAN",&nsconfig.joinserviceschan, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, ns_help_set_joinserviceschan, NULL,( void* )1 }, {"PINGTIME", &nsconfig.pingtime, SET_TYPE_INT, 0, 0, NS_ULEVEL_ADMIN, NULL, ns_help_set_pingtime, NULL,( void* )120 }, - {"VERSIONSCAN", &me.versionscan, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, ns_help_set_versionscan, NULL,( void* )1 }, {"SERVICECMODE", me.servicescmode, SET_TYPE_STRING, 0, MODESIZE, NS_ULEVEL_ADMIN, NULL, ns_help_set_servicecmode, NULL, NULL }, {"SERVICEUMODE", me.servicesumode, SET_TYPE_STRING, 0, MODESIZE, NS_ULEVEL_ADMIN, NULL, ns_help_set_serviceumode, NULL, NULL }, {"CMDCHAR", nsconfig.cmdchar, SET_TYPE_STRING, 0, 2, NS_ULEVEL_ADMIN, NULL, ns_help_set_cmdchar, NULL,( void* )"!" }, @@ -183,8 +182,8 @@ ModuleEvent neostats_events[] = static int services_event_ctcpversion( CmdParams *cmdparams ) { dlog(DEBUG1, "Got Version reply event in services.c from %s: %s", cmdparams->source->name, cmdparams->param); - strlcpy( cmdparams->source->version, cmdparams->param, MAXHOST ); - SendAllModuleEvent( EVENT_CTCPVERSIONRPLBC, cmdparams ); + /*strlcpy( cmdparams->source->version, cmdparams->param, MAXHOST );*/ + /*SendAllModuleEvent( EVENT_CTCPVERSIONRPLBC, cmdparams );*/ return NS_SUCCESS; }