diff options
author | Jayanth Othayoth <ojayanth@in.ibm.com> | 2018-04-02 07:59:34 -0500 |
---|---|---|
committer | Vernon Mauery <vernon.mauery@linux.intel.com> | 2018-04-11 20:59:14 +0000 |
commit | 0922bde4e5a371b6493f178071f252c195f71e81 (patch) | |
tree | 99a4af15a22596b51a07a6e144c1da000979dccd /sensorhandler.cpp | |
parent | 3d23048896b7171b940c56fe4e403b1d23103eef (diff) | |
download | phosphor-host-ipmid-0922bde4e5a371b6493f178071f252c195f71e81.tar.gz phosphor-host-ipmid-0922bde4e5a371b6493f178071f252c195f71e81.zip |
sensorhandler: Enable mutability based set function
Resolves openbmc/openbmc#2980
Change-Id: I67afd4e84ec96e5cfc2dd315604d70f41c67a438
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Diffstat (limited to 'sensorhandler.cpp')
-rw-r--r-- | sensorhandler.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sensorhandler.cpp b/sensorhandler.cpp index 3a47e20..1a66a1e 100644 --- a/sensorhandler.cpp +++ b/sensorhandler.cpp @@ -379,6 +379,13 @@ ipmi_ret_t setSensorReading(void *request) try { + if (ipmi::sensor::Mutability::Write != + (iter->second.mutability & ipmi::sensor::Mutability::Write)) + { + log<level::ERR>("Sensor Set operation is not allowed", + entry("SENSOR_NUM=%d", cmdData.number)); + return IPMI_CC_ILLEGAL_COMMAND; + } return iter->second.updateFunc(cmdData, iter->second); } catch (InternalFailure& e) |