From 6fcbfc072387752ec345d7589e986b9959f350fc Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 11 Apr 2020 15:09:34 +0100 Subject: Add support for limiting what opers can subscribe to snomasks. --- src/coremods/core_user/umode_s.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/coremods') diff --git a/src/coremods/core_user/umode_s.cpp b/src/coremods/core_user/umode_s.cpp index 6e1f6d43d..5994f97fb 100644 --- a/src/coremods/core_user/umode_s.cpp +++ b/src/coremods/core_user/umode_s.cpp @@ -89,7 +89,8 @@ std::string ModeUserServerNoticeMask::ProcessNoticeMasks(User* user, const std:: case '*': for (size_t j = 0; j < 64; j++) { - if (ServerInstance->SNO->IsSnomaskUsable(j+'A')) + const char chr = j + 'A'; + if (user->HasSnomaskPermission(chr) && ServerInstance->SNO->IsSnomaskUsable(chr)) curr[j] = adding; } break; @@ -103,6 +104,12 @@ std::string ModeUserServerNoticeMask::ProcessNoticeMasks(User* user, const std:: user->WriteNumeric(ERR_UNKNOWNSNOMASK, *i, "is an unknown snomask character"); continue; } + else if (!user->HasSnomaskPermission(*i)) + { + user->WriteNumeric(ERR_NOPRIVILEGES, InspIRCd::Format("Permission Denied - Oper type %s does not have access to snomask %c", + user->oper->name.c_str(), *i)); + continue; + } } else if (!(((*i >= 'a') && (*i <= 'z')) || ((*i >= 'A') && (*i <= 'Z')))) continue; -- cgit v1.2.3