From 317d55f3f1ca3ed75b384ce69dbb696e93c71b22 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 29 Mar 2014 18:18:27 -0400 Subject: Fix ns_set password to read the correct parameter. Even though 1 is past the "end" of the vector, because vectors never shrink and due to how the command parser works, it is always less than the capacity, and almost always contains what is in params[0] (though this is of course implementation dependant), which is why this was not identified sooner, as it executes cleanly under valgrind on every machine I can find. --- modules/commands/ns_set.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/commands') diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index e6526a913..063b7c4dd 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -119,7 +119,7 @@ class CommandNSSetPassword : public Command void Execute(CommandSource &source, const std::vector ¶ms) anope_override { - const Anope::string ¶m = params[1]; + const Anope::string ¶m = params[0]; unsigned len = param.length(); if (Anope::ReadOnly) -- cgit From 10732baec20781b97f3d5f62236fa689c0a05a98 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 31 Mar 2014 22:41:02 -0400 Subject: Fix compile error in cs_set_misc with C++11 enabled --- modules/commands/cs_set_misc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/commands') diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 3457bbed3..481b54cb9 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -18,7 +18,7 @@ static std::map descriptions; struct CSMiscData; static Anope::map *> items; -static ExtensibleItem *GetItem(const Anope::string &name) anope_override +static ExtensibleItem *GetItem(const Anope::string &name) { ExtensibleItem* &it = items[name]; if (!it) -- cgit From 1f8dec4c242200403640ed72043899aa08cb81dd Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 6 Apr 2014 18:09:36 -0400 Subject: Fix /os mode to not require a mode when setting param modes which taken no argument when setting --- modules/commands/os_mode.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/commands') diff --git a/modules/commands/os_mode.cpp b/modules/commands/os_mode.cpp index 16c29c8de..379879844 100644 --- a/modules/commands/os_mode.cpp +++ b/modules/commands/os_mode.cpp @@ -89,7 +89,9 @@ class CommandOSMode : public Command Anope::string param, param_log; if (cm->type != MODE_REGULAR) { - if (!sep.GetToken(param)) + if (cm->type == MODE_PARAM && !add && anope_dynamic_static_cast(cm)->minus_no_arg) + ; + else if (!sep.GetToken(param)) continue; param_log = param; -- cgit From 43219d3906a6a1b980319ae993c53f7606e438a6 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 6 Apr 2014 23:01:10 -0400 Subject: Do not apply module changes on rehash until after the new config has been applied. Fix renaming opertypes on reload. --- modules/commands/os_reload.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/commands') diff --git a/modules/commands/os_reload.cpp b/modules/commands/os_reload.cpp index 13b0a8254..09654811b 100644 --- a/modules/commands/os_reload.cpp +++ b/modules/commands/os_reload.cpp @@ -26,8 +26,11 @@ class CommandOSReload : public Command Log(LOG_ADMIN, source, this); Configuration::Conf *new_config = new Configuration::Conf(); - delete Config; + Configuration::Conf *old = Config; Config = new_config; + Config->Post(old); + delete old; + source.Reply(_("Services' configuration has been reloaded.")); } catch (const ConfigException &ex) -- cgit