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') 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') 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 fb5c5e3442994985af92122803db7b65ed9a4097 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 2 Apr 2014 22:37:35 -0400 Subject: Set minus no arg on +l in all proto mods Set oper modes/vhost on oper too, evan after iding Add umode +q to plexus --- modules/protocol/bahamut.cpp | 2 +- modules/protocol/hybrid.cpp | 2 +- modules/protocol/ngircd.cpp | 2 +- modules/protocol/plexus.cpp | 5 +++-- modules/protocol/ratbox.cpp | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index a114db890..72c3ee8f9 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -522,7 +522,7 @@ class ProtoBahamut : public Module ModeManager::AddChannelMode(new ChannelMode("INVITE", 'i')); ModeManager::AddChannelMode(new ChannelModeFlood('f', false)); ModeManager::AddChannelMode(new ChannelModeKey('k')); - ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l')); + ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l', true)); ModeManager::AddChannelMode(new ChannelMode("MODERATED", 'm')); ModeManager::AddChannelMode(new ChannelMode("NOEXTERNAL", 'n')); ModeManager::AddChannelMode(new ChannelMode("PRIVATE", 'p')); diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 0fa4287e6..9d928a106 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -632,7 +632,7 @@ class ProtoHybrid : public Module ModeManager::AddChannelMode(new ChannelModeStatus("OP", 'o', '@', 2)); /* l/k */ - ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l')); + ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l', true)); ModeManager::AddChannelMode(new ChannelModeKey('k')); /* Add channel modes */ diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index b0b2bb522..81ba28a6a 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -650,7 +650,7 @@ class ProtongIRCd : public Module /* Add channel modes */ ModeManager::AddChannelMode(new ChannelMode("INVITE", 'i')); ModeManager::AddChannelMode(new ChannelModeKey('k')); - ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l')); + ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l', true)); ModeManager::AddChannelMode(new ChannelMode("MODERATED", 'm')); ModeManager::AddChannelMode(new ChannelMode("REGMODERATED", 'M')); ModeManager::AddChannelMode(new ChannelMode("NOEXTERNAL", 'n')); diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index c4d39e4a9..0770d20a4 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -334,8 +334,9 @@ class ProtoPlexus : public Module ModeManager::AddUserMode(new UserMode("INVIS", 'i')); ModeManager::AddUserMode(new UserModeOperOnly("LOCOPS", 'l')); ModeManager::AddUserMode(new UserMode("OPER", 'o')); - ModeManager::AddUserMode(new UserMode("PRIV", 'p')); ModeManager::AddUserMode(new UserModeOperOnly("NETADMIN", 'N')); + ModeManager::AddUserMode(new UserMode("PRIV", 'p')); + ModeManager::AddUserMode(new UserMode("ROUTING", 'q')); ModeManager::AddUserMode(new UserModeNoone("REGISTERED", 'r')); ModeManager::AddUserMode(new UserMode("REGPRIV", 'R')); ModeManager::AddUserMode(new UserModeOperOnly("SNOMASK", 's')); @@ -359,7 +360,7 @@ class ProtoPlexus : public Module ModeManager::AddChannelMode(new ChannelModeStatus("OWNER", 'q', '~', 4)); /* l/k */ - ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l')); + ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l', true)); ModeManager::AddChannelMode(new ChannelModeKey('k')); /* Add channel modes */ diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 72cdc9573..89e0f0176 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -274,7 +274,7 @@ class ProtoRatbox : public Module ModeManager::AddChannelMode(new ChannelModeStatus("OP", 'o', '@', 1)); /* l/k */ - ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l')); + ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l', true)); ModeManager::AddChannelMode(new ChannelModeKey('k')); /* channel modes */ -- 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') 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') 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