From 407aa55e58bb971f8af845fcb3556a0eeaf3d0b0 Mon Sep 17 00:00:00 2001 From: stskeeps Date: Sun, 30 Dec 2001 19:51:31 +0000 Subject: [PATCH] +- Fixed problem with EventDel, doing eventptr instead of eventptr->name +- Fixed bug #0000019 reported by Syzop, and bug found by same to deal with + individual module loading --- Changes | 3 +++ src/events.c | 2 +- src/modules/l_commands.c | 6 +++--- src/modules/m_away.c | 2 +- src/modules/m_mkpasswd.c | 2 +- src/modules/m_svsmode.c | 2 +- src/modules/m_svsmotd.c | 2 +- src/modules/m_svsnick.c | 2 +- src/modules/m_svsnoop.c | 19 ++++++++++++++----- src/modules/m_svso.c | 2 +- 10 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Changes b/Changes index 48b572e0f..a240ca855 100644 --- a/Changes +++ b/Changes @@ -1058,3 +1058,6 @@ seen. gmtime warning still there - C++ comment fix, lnxgk again. - Crash in scan_http fixed, h->in instead of &h->in = bad - Made tld::mask be user@host instead of just host +- Fixed problem with EventDel, doing eventptr instead of eventptr->name +- Fixed bug #0000019 reported by Syzop, and bug found by same to deal with + individual module loading diff --git a/src/events.c b/src/events.c index b390b0055..6b1a88d41 100644 --- a/src/events.c +++ b/src/events.c @@ -145,7 +145,7 @@ inline void DoEvents(void) eventptr->howmany--; if (eventptr->howmany == 0) { - temp.next = EventDel(eventptr->name); + temp.next = EventDel(eventptr); eventptr = &temp; continue; } diff --git a/src/modules/l_commands.c b/src/modules/l_commands.c index 876046a98..c8778fc2a 100644 --- a/src/modules/l_commands.c +++ b/src/modules/l_commands.c @@ -50,8 +50,8 @@ #ifdef SCAN_API extern ModuleHeader scan_socks_Header; extern ModuleHeader scan_http_Header; - #endif +extern ModuleHeader m_svsnoop_Header; /* Place includes here */ /* replace this with a common name of your module */ @@ -82,9 +82,7 @@ int l_commands_Init(int module_load) /* * We call our add_Command crap here */ -#ifdef SCAN_API Module p; -#endif m_sethost_Init(module_load); m_setname_Init(module_load); m_chghost_Init(module_load); @@ -98,6 +96,8 @@ int l_commands_Init(int module_load) m_who_Init(module_load); m_mkpasswd_Init(module_load); m_away_Init(module_load); + p.header = &m_svsnoop_Header; + Module_Depend_Resolve(&p); m_svsnoop_Init(module_load); m_svso_Init(module_load); m_svsnick_Init(module_load); diff --git a/src/modules/m_away.c b/src/modules/m_away.c index 7f2991a92..0dce2cddf 100644 --- a/src/modules/m_away.c +++ b/src/modules/m_away.c @@ -58,7 +58,7 @@ ModuleHeader m_away_Header ModuleHeader Mod_Header #endif = { - "test", + "m_away", "$Id$", "command /away", "3.2-b5", diff --git a/src/modules/m_mkpasswd.c b/src/modules/m_mkpasswd.c index 6662ae169..14b1abf18 100644 --- a/src/modules/m_mkpasswd.c +++ b/src/modules/m_mkpasswd.c @@ -58,7 +58,7 @@ ModuleHeader m_mkpasswd_Header ModuleHeader Mod_Header #endif = { - "test", + "m_mkpasswd", "$Id$", "command /mkpasswd", "3.2-b5", diff --git a/src/modules/m_svsmode.c b/src/modules/m_svsmode.c index f252132d3..339ea48d4 100644 --- a/src/modules/m_svsmode.c +++ b/src/modules/m_svsmode.c @@ -61,7 +61,7 @@ ModuleHeader m_svsmode_Header ModuleHeader Mod_Header #endif = { - "test", + "m_svsmode", "$Id$", "command /svsmode and svs2mode", "3.2-b5", diff --git a/src/modules/m_svsmotd.c b/src/modules/m_svsmotd.c index 92ca0f037..3a35813b3 100644 --- a/src/modules/m_svsmotd.c +++ b/src/modules/m_svsmotd.c @@ -58,7 +58,7 @@ ModuleHeader m_svsmotd_Header ModuleHeader Mod_Header #endif = { - "test", + "m_svsmotd", "$Id$", "command /svsmotd", "3.2-b5", diff --git a/src/modules/m_svsnick.c b/src/modules/m_svsnick.c index 27e36948c..dea81e2af 100644 --- a/src/modules/m_svsnick.c +++ b/src/modules/m_svsnick.c @@ -58,7 +58,7 @@ ModuleHeader m_svsnick_Header ModuleHeader Mod_Header #endif = { - "test", + "m_svsnick", "$Id$", "command /svsnick", "3.2-b5", diff --git a/src/modules/m_svsnoop.c b/src/modules/m_svsnoop.c index bc81d87ed..072828304 100644 --- a/src/modules/m_svsnoop.c +++ b/src/modules/m_svsnoop.c @@ -50,9 +50,18 @@ DLLFUNC int m_svsnoop(aClient *cptr, aClient *sptr, int parc, char *parv[]); #define MSG_SVSNOOP "SVSNOOP" #define TOK_SVSNOOP "f" -extern int SVSNOOP; + extern ircstats IRCstats; +static int *xSVSNOOP = NULL; +#ifdef STATIC_LINKING +extern int SVSNOOP; +#endif + +static Mod_SymbolDepTable modsymdep[] = { + MOD_Dep(SVSNOOP, xSVSNOOP, "src/modules/m_oper.so") + }; + #ifndef DYNAMIC_LINKING ModuleHeader m_svsnoop_Header #else @@ -60,11 +69,11 @@ ModuleHeader m_svsnoop_Header ModuleHeader Mod_Header #endif = { - "test", + "m_svsnoop", "$Id$", "command /svsnoop", "3.2-b5", - NULL + modsymdep }; #ifdef DYNAMIC_LINKING @@ -111,7 +120,7 @@ int m_svsnoop(aClient *cptr, aClient *sptr, int parc, char *parv[]) { if (parv[2][0] == '+') { - SVSNOOP = 1; + *xSVSNOOP = 1; sendto_ops("This server has been placed in NOOP mode"); for (acptr = &me; acptr; acptr = acptr->prev) { @@ -136,7 +145,7 @@ int m_svsnoop(aClient *cptr, aClient *sptr, int parc, char *parv[]) } else { - SVSNOOP = 0; + *xSVSNOOP = 0; sendto_ops("This server is no longer in NOOP mode"); } } diff --git a/src/modules/m_svso.c b/src/modules/m_svso.c index 9e88178fa..9116e07c7 100644 --- a/src/modules/m_svso.c +++ b/src/modules/m_svso.c @@ -92,7 +92,7 @@ ModuleHeader m_svso_Header ModuleHeader Mod_Header #endif = { - "test", + "m_svso", "$Id$", "command /svso", "3.2-b5",