user_mgmt: Discard no-access privilege
Due wrong interpretation of the IPMI spec there is appeared the
`no-access` privilege in the OpenBMC. But it's a state of unconfigured
channel and shouldn't be used as the valid user's privilege.
This commit is a part of the patch set removing `priv-noaccess` from
OpenBMC. This makes `ipmid` discarding the attempts to set
`priv-noaccess` privilege for existing users.
Tested:
Command: ipmitool user priv <user id> 0xF
Response: IPMI command failed: Invalid data field in request
Command: ipmitool channel setaccesss <channel id> <user id> privilege=0xF
Response: IPMI command failed: Invalid data field in request
Change-Id: Id1c65d83e94e6f7f161afd26840331db7ca0c745
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index 326035e..7ffee61 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -502,7 +502,7 @@
bool UserAccess::isValidPrivilege(const uint8_t priv)
{
// Callback privilege is deprecated in OpenBMC
- return (isValidPrivLimit(priv) || priv == privNoAccess);
+ return isValidPrivLimit(priv);
}
uint8_t UserAccess::getUsrMgmtSyncIndex()