[PATCH openpower-host-ipmi-oem] Support for restricted mode for IPMI commands

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue Mar 29 06:40:33 AEDT 2016


From: tomjose <tomjoseph at in.ibm.com>

---
 oemhandler.C | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/oemhandler.C b/oemhandler.C
index 22452d6..1ffb8eb 100644
--- a/oemhandler.C
+++ b/oemhandler.C
@@ -5,6 +5,8 @@
 #include <string.h>
 #include <systemd/sd-bus.h>
 
+extern bool restricted_mode;
+
 void register_netfn_oem_partial_esel() __attribute__((constructor));
 
 const char *g_esel_path = "/tmp/esel";
@@ -81,6 +83,11 @@ ipmi_ret_t ipmi_ibm_oem_prep_fw_update(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
     ipmi_ret_t ipmi_rc = IPMI_CC_OK;
     *data_len = 0;
 
+    if(restricted_mode)
+    {
+       return IPMI_CC_INSUFFICIENT_PRIVILEGE;
+    }
+
     int rc = 0;
     std::ofstream rwfs_file;
     const char  *busname = "org.openbmc.control.Bmc";
-- 
2.7.1




More information about the openbmc mailing list