Skip to content

Commit

Permalink
Core/Chat: Fix lower security check for GM commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
r4d1sh committed Feb 14, 2025
1 parent 4bec944 commit dbe231f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion sql/base/auth_database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,8 @@ INSERT INTO `updates` VALUES
('2024_08_28_01_auth.sql','BC5D74553AF2D92606F55C1C462D2700FE73BD34','ARCHIVED','2024-08-28 14:55:05',0),
('2024_08_30_00_auth.sql','BD76942F1C29AAA2450E051E7CA552672B5E331B','ARCHIVED','2024-08-30 19:24:30',0),
('2024_09_26_00_auth.sql','E37C3997FD7851EA360774AC568912846C448272','ARCHIVED','2024-09-26 18:27:26',0),
('2024_11_22_00_auth.sql','F2C1D1572A3968E9E9D778EF7DC82778DF3EF887','ARCHIVED','2024-11-22 23:18:14',0);
('2024_11_22_00_auth.sql','F2C1D1572A3968E9E9D778EF7DC82778DF3EF887','ARCHIVED','2024-11-22 23:18:14',0),
('2025_02_14_00_auth.sql','1D8D53BED4F35511C1E31DCABE3B40B6B4698340','ARCHIVED','2025-02-14 17:20:00',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down
2 changes: 2 additions & 0 deletions sql/updates/auth/3.3.5/2025_02_14_00_auth.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--
UPDATE `name` = 'Can ignore non-strong lower security checks if it\'s disabled in config' WHERE `id` = 47;
2 changes: 1 addition & 1 deletion src/server/game/Accounts/RBAC.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ enum RBACPermissions
RBAC_PERM_RECEIVE_GLOBAL_GM_TEXTMESSAGE = 44,
RBAC_PERM_SILENTLY_JOIN_CHANNEL = 45,
RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR = 46,
RBAC_PERM_CHECK_FOR_LOWER_SECURITY = 47,
RBAC_PERM_CAN_IGNORE_LOWER_SECURITY_CHECK = 47,
RBAC_PERM_COMMANDS_PINFO_CHECK_PERSONAL_DATA = 48,
RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE = 49,
RBAC_PERM_MAY_CHECK_OWN_EMAIL = 50,
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Chat/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
return false;

// ignore only for non-players for non strong checks (when allow apply command at least to same sec level)
if (m_session->HasPermission(rbac::RBAC_PERM_CHECK_FOR_LOWER_SECURITY) && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY))
if (m_session->HasPermission(rbac::RBAC_PERM_CAN_IGNORE_LOWER_SECURITY_CHECK) && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY))
return false;

if (target)
Expand Down
8 changes: 6 additions & 2 deletions src/server/worldserver/worldserver.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2178,8 +2178,12 @@ GM.AllowInvite = 0

#
# GM.LowerSecurity
# Description: Allow lower security levels to use commands on higher security level
# characters.
# Description: Disallow lower security levels to use commands on higher security level
# characters. Regardless of this value, lower security check is always
# enabled for accounts without RBAC_PERM_CAN_IGNORE_LOWER_SECURITY_CHECK.
# This option also does not affect "strong" checks, such as in
# certain .account and .rbac commands, which are always enabled.
#
# Default: 0 - (Disabled)
# 1 - (Enabled)

Expand Down

0 comments on commit dbe231f

Please sign in to comment.