summaryrefslogtreecommitdiffstats
path: root/storagehandler.cpp
diff options
context:
space:
mode:
authorTom <tomjoseph@in.ibm.com>2016-09-06 17:21:23 +0530
committerTom Joseph <tomjoseph@in.ibm.com>2017-01-17 16:52:30 +0530
commit0573237f4521a0087153cded38814461c8978262 (patch)
tree94e7345d7b34c81a436ab6c7e46554762e0a0718 /storagehandler.cpp
parent9e5232e59573ae4ddc6dd2064a813fd650dd0695 (diff)
downloadphosphor-host-ipmid-0573237f4521a0087153cded38814461c8978262.tar.gz
phosphor-host-ipmid-0573237f4521a0087153cded38814461c8978262.zip
Add privilege level for each IPMI command
Change-Id: I07f160c6ea83dc91f46e21f263c4cf994aff081d Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'storagehandler.cpp')
-rw-r--r--storagehandler.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 41d76b8..e02dd19 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -232,23 +232,35 @@ ipmi_ret_t ipmi_storage_add_sel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
void register_netfn_storage_functions()
{
+ // <Wildcard Command>
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_WILDCARD);
- ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_WILDCARD, nullptr, ipmi_storage_wildcard);
+ ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_WILDCARD, NULL, ipmi_storage_wildcard,
+ PRIVILEGE_USER);
+ // <Get SEL Time>
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_TIME);
- ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_TIME, nullptr, ipmi_storage_get_sel_time);
+ ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_TIME, NULL, ipmi_storage_get_sel_time,
+ PRIVILEGE_USER);
+ // <Set SEL Time>
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME);
- ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME, nullptr, ipmi_storage_set_sel_time);
+ ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME, NULL, ipmi_storage_set_sel_time,
+ PRIVILEGE_OPERATOR);
+ // <Get SEL Info>
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO);
- ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO, nullptr, ipmi_storage_get_sel_info);
+ ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO, NULL, ipmi_storage_get_sel_info,
+ PRIVILEGE_USER);
+ // <Reserve SEL>
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_RESERVE_SEL);
- ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_RESERVE_SEL, nullptr, ipmi_storage_reserve_sel);
+ ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_RESERVE_SEL, NULL, ipmi_storage_reserve_sel,
+ PRIVILEGE_USER);
+ // <Add SEL Entry>
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_ADD_SEL);
- ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_ADD_SEL, nullptr, ipmi_storage_add_sel);
+ ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_ADD_SEL, NULL, ipmi_storage_add_sel,
+ PRIVILEGE_OPERATOR);
return;
}
OpenPOWER on IntegriCloud