Change Get DCMI sensor info privilege to OPERATOR
This commit changes the privilege to execute the command get DCMI sensor
info (command 0x07) from USER to OPERATOR to match with Table 6.1 of
DCMI specification.
Tested:
1. Create a user with USER/READONLY privilege
2. $ipmitool -H ${BMC_IP} -U root -P 0penBmc -C 17 -I lanplus \
-L USER raw 0x2c 0x07 0xdc 0x01 0x41 0x00 0x00
Result: Unable to send RAW command
(channel=0x0 netfn=0x2c lun=0x0 cmd=0x7 rsp=0xd4):
Insufficient privilege level
3. Change the user privilege to OPERATOR or ADMIN:
$ipmitool -H ${BMC_IP} -U root -P 0penBmc -C 17 -I lanplus \
user priv <user id> 0x3/0x4
4. Can successfully get the result from step 2.
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: Id841fe94a79dcbf389249209b27ad6b08f39d119
diff --git a/dcmihandler.cpp b/dcmihandler.cpp
index e525f8e..d34ab31 100644
--- a/dcmihandler.cpp
+++ b/dcmihandler.cpp
@@ -1440,7 +1440,7 @@
#ifndef FEATURE_DYNAMIC_SENSORS
// <Get Sensor Info>
ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::GET_SENSOR_INFO, NULL,
- getSensorInfo, PRIVILEGE_USER);
+ getSensorInfo, PRIVILEGE_OPERATOR);
#endif
// <Get DCMI Configuration Parameters>
ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::GET_CONF_PARAMS, NULL,