diff options
author | Sadie Powell <sadie@witchery.services> | 2020-04-11 15:09:34 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-04-11 15:44:51 +0100 |
commit | 6fcbfc072387752ec345d7589e986b9959f350fc (patch) | |
tree | c62f9074e1d1409ac4379025d6938cbaf8c8e29f /src/coremods | |
parent | 41f781a9a6560eab393b18815dbdfa9073c6810b (diff) |
Add support for limiting what opers can subscribe to snomasks.
Diffstat (limited to 'src/coremods')
-rw-r--r-- | src/coremods/core_user/umode_s.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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; |