diff --git a/Changes b/Changes index 4f9346ee6..f873c8982 100644 --- a/Changes +++ b/Changes @@ -1065,3 +1065,6 @@ seen. gmtime warning still there - Fixed sts's fix for svsnoop (since he failed to test his fix) - Fixed a bug where the win32 editor would always say the file was modified even if it wasn't +- Fixed .1081 problem, see bug #0000020 for more information about how + it REALLY should be fixed + diff --git a/src/ircd.c b/src/ircd.c index 2fa638285..86307e51c 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -85,6 +85,7 @@ int un_gid = 99; #ifndef _WIN32 extern char unreallogo[]; #endif +int SVSNOOP = 0; extern char *buildid; time_t timeofday = 0; LoopStruct loop; diff --git a/src/modules.c b/src/modules.c index 5fa839fdb..236185a7a 100644 --- a/src/modules.c +++ b/src/modules.c @@ -311,6 +311,35 @@ int Module_Unload(char *name, int unload) return 1; } +vFP Module_SymEx( +#ifdef _WIN32 + HMODULE mod +#else + void *mod +#endif + , char *name) +{ +#ifndef STATIC_LINKING + vFP fp; + char buf[512]; + int i; + + if (!name) + return NULL; + + ircsprintf(buf, "_%s", name); + + /* Run through all modules and check for symbols */ + irc_dlsym(mod, name, fp); + if (fp) + return (fp); + irc_dlsym(mod, buf, fp); + if (fp) + return (fp); + return NULL; +#endif + +} vFP Module_Sym(char *name) { @@ -449,6 +478,11 @@ int Module_Depend_Resolve(Module *p) #ifndef STATIC_LINKING while (d->pointer) { + if ((*(d->pointer) = Module_SymEx(p->dll, d->symbol))) + { + d++; + continue; + } *(d->pointer) = Module_SymX(d->symbol, &parental); if (!*(d->pointer)) { diff --git a/src/modules/l_commands.c b/src/modules/l_commands.c index c8778fc2a..984911ebe 100644 --- a/src/modules/l_commands.c +++ b/src/modules/l_commands.c @@ -96,8 +96,6 @@ 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_oper.c b/src/modules/m_oper.c index e25e5c1a8..cc00dc678 100644 --- a/src/modules/m_oper.c +++ b/src/modules/m_oper.c @@ -149,7 +149,8 @@ int m_oper_Unload(int module_unload) ** parv[1] = oper name ** parv[2] = oper password */ -int SVSNOOP; + +extern int SVSNOOP; DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) { ConfigItem_oper *aconf; diff --git a/src/modules/m_svsnoop.c b/src/modules/m_svsnoop.c index 6a54eeebb..3152c828e 100644 --- a/src/modules/m_svsnoop.c +++ b/src/modules/m_svsnoop.c @@ -52,16 +52,8 @@ DLLFUNC int m_svsnoop(aClient *cptr, aClient *sptr, int parc, char *parv[]); 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"), - NULL - }; #ifndef DYNAMIC_LINKING ModuleHeader m_svsnoop_Header @@ -74,7 +66,7 @@ ModuleHeader Mod_Header "$Id$", "command /svsnoop", "3.2-b5", - modsymdep + NULL }; #ifdef DYNAMIC_LINKING @@ -121,7 +113,7 @@ int m_svsnoop(aClient *cptr, aClient *sptr, int parc, char *parv[]) { if (parv[2][0] == '+') { - *xSVSNOOP = 1; + SVSNOOP = 1; sendto_ops("This server has been placed in NOOP mode"); for (acptr = &me; acptr; acptr = acptr->prev) { @@ -146,7 +138,7 @@ int m_svsnoop(aClient *cptr, aClient *sptr, int parc, char *parv[]) } else { - *xSVSNOOP = 0; + SVSNOOP = 0; sendto_ops("This server is no longer in NOOP mode"); } }