summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-08 16:28:50 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-08 16:28:50 +0000
commitc01f8cad22a72bf1a70bf77afe841a6ba60c73fe (patch)
tree0b7754c466e7933f8ffbd5661498c0eb343ad36a
parentcea53460b02f51c1d91540f4d371262bf8bdfa63 (diff)
Never unset mod_current_module in functions that modules might call, instead save the old values and reset them
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@3000 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes2
-rw-r--r--src/commands.c8
-rw-r--r--src/events.c16
-rw-r--r--version.log3
4 files changed, 14 insertions, 15 deletions
diff --git a/Changes b/Changes
index 2a5b9082e..da76df863 100644
--- a/Changes
+++ b/Changes
@@ -13,8 +13,6 @@ Anope Version 1.8 - SVN
4/28 F Fixed a bug that could make some nick requests disappear [ #00]
5/18 F Fixed English and grammar in e-mail messages [ #00]
5/23 F Fixed SQUITing juped servers on InspIRCd 1.2 [#1165]
-6/4 F Check if user is identified before telling them to identify [ #00]
-6/4 F Moved EVENT_CHANGE_NICK call to after the nick change processing [ #00]
Anope Version 1.8.4
-------------------
diff --git a/src/commands.c b/src/commands.c
index cbc99b800..481a74854 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -95,6 +95,8 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
notice_lang(service, u, OPER_DEFCON_DENIED);
}
} else {
+ char *mod_current_module_name_save = mod_current_module_name;
+ Module *mod_current_module_save = mod_current_module;
mod_current_module_name = c->mod_name;
mod_current_module = findModule(c->mod_name);
if ((c->has_priv == NULL) || c->has_priv(u)) {
@@ -106,8 +108,6 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
mod_current_module = findModule(current->mod_name);
if (current->routine)
retVal = current->routine(u);
- mod_current_module_name = NULL;
- mod_current_module = NULL;
current = current->next;
}
}
@@ -116,8 +116,8 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
alog("Access denied for %s with service %s and command %s",
u->nick, service, cmd);
}
- mod_current_module_name = NULL;
- mod_current_module = NULL;
+ mod_current_module_name = mod_current_module_name_save;
+ mod_current_module = mod_current_module_save;
}
} else {
if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u)) {
diff --git a/src/events.c b/src/events.c
index 2d7006a0c..58871d2d4 100644
--- a/src/events.c
+++ b/src/events.c
@@ -127,23 +127,23 @@ void event_message_process(char *eventbuf)
/* Do something with the message. */
evm = find_event(cmd);
if (evm) {
+ char *mod_current_module_name_save = mod_current_module_name;
+ Module *mod_current_module_save = mod_current_module;
if (evm->func) {
mod_current_module_name = evm->mod_name;
mod_current_module = findModule(evm->mod_name);
retVal = evm->func(source, ac, av);
- mod_current_module_name = NULL;
- mod_current_module = NULL;
if (retVal == MOD_CONT) {
current = evm->next;
while (current && current->func && retVal == MOD_CONT) {
mod_current_module_name = current->mod_name;
mod_current_module = findModule(current->mod_name);
retVal = current->func(source, ac, av);
- mod_current_module_name = NULL;
- mod_current_module = NULL;
current = current->next;
}
}
+ mod_current_module_name = mod_current_module_name_save;
+ mod_current_module = mod_current_module_save;
}
}
/* Free argument list we created */
@@ -162,22 +162,22 @@ void event_process_hook(const char *name, int argc, char **argv)
evh = find_eventhook(name);
if (evh) {
if (evh->func) {
+ char *mod_current_module_name_save = mod_current_module_name;
+ Module *mod_current_module_save = mod_current_module;
mod_current_module = findModule(evh->mod_name);
mod_current_module_name = evh->mod_name;
retVal = evh->func(argc, argv);
- mod_current_module = NULL;
- mod_current_module_name = NULL;
if (retVal == MOD_CONT) {
current = evh->next;
while (current && current->func && retVal == MOD_CONT) {
mod_current_module = findModule(current->mod_name);
mod_current_module_name = current->mod_name;
retVal = current->func(argc, argv);
- mod_current_module = NULL;
- mod_current_module_name = NULL;
current = current->next;
}
}
+ mod_current_module_name = mod_current_module_name_save;
+ mod_current_module = mod_current_module_save;
}
}
}
diff --git a/version.log b/version.log
index 5a6ccb549..02aa9fd23 100644
--- a/version.log
+++ b/version.log
@@ -9,9 +9,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="4"
VERSION_EXTRA="-svn"
-VERSION_BUILD="2999"
+VERSION_BUILD="3000"
# $Log$ # Changes since the 1.8.4 Release
+#Revision 3000 - Never unset mod_current_module in functions that modules might call, instead save the old values and reset them
#Revision 2999 - Moved EVENT_CHANGE_NICK call to after anope_cmd_nc_change() call. Added user identified check to validate_user() to prevent identified user being told to identify.
#Revision 2993 - Fixed db-mergers handling of bot collisions
#Revision 2991 - Fixed a crash on shutdown when running Anope on Mac