summaryrefslogtreecommitdiffstats
path: root/ipmid-new.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ipmid-new.cpp')
-rw-r--r--ipmid-new.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index f210c5d..03b6b8a 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -477,6 +477,7 @@ auto executionEntry(boost::asio::yield_context yield,
Privilege privilege = Privilege::None;
int rqSA = 0;
uint8_t userId = 0; // undefined user
+ uint32_t sessionId = 0;
// figure out what channel the request came in on
uint8_t channel = channelFromMessage(m);
@@ -489,15 +490,19 @@ auto executionEntry(boost::asio::yield_context yield,
return dbusResponse(ipmi::ccDestinationUnavailable);
}
- // session-based channels are required to provide userId/privilege
+ // session-based channels are required to provide userId, privilege and
+ // sessionId
if (getChannelSessionSupport(channel) != EChannelSessSupported::none)
{
try
{
Value requestPriv = options.at("privilege");
Value requestUserId = options.at("userId");
+ Value requestSessionId = options.at("currentSessionId");
privilege = static_cast<Privilege>(std::get<int>(requestPriv));
userId = static_cast<uint8_t>(std::get<int>(requestUserId));
+ sessionId =
+ static_cast<uint32_t>(std::get<uint32_t>(requestSessionId));
}
catch (const std::exception& e)
{
@@ -533,11 +538,13 @@ auto executionEntry(boost::asio::yield_context yield,
log<level::DEBUG>("Set up ipmi context", entry("SENDER=%s", sender.c_str()),
entry("NETFN=0x%X", netFn), entry("CMD=0x%X", cmd),
entry("CHANNEL=%u", channel), entry("USERID=%u", userId),
+ entry("SESSIONID=0x%X", sessionId),
entry("PRIVILEGE=%u", static_cast<uint8_t>(privilege)),
entry("RQSA=%x", rqSA));
- auto ctx = std::make_shared<ipmi::Context>(getSdBus(), netFn, cmd, channel,
- userId, privilege, rqSA, yield);
+ auto ctx =
+ std::make_shared<ipmi::Context>(getSdBus(), netFn, cmd, channel, userId,
+ sessionId, privilege, rqSA, yield);
auto request = std::make_shared<ipmi::message::Request>(
ctx, std::forward<std::vector<uint8_t>>(data));
message::Response::ptr response = executeIpmiCommand(request);
@@ -750,7 +757,7 @@ void handleLegacyIpmiCommand(sdbusplus::message::message& m)
m.read(seq, netFn, lun, cmd, data);
std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus();
auto ctx = std::make_shared<ipmi::Context>(
- bus, netFn, cmd, 0, 0, ipmi::Privilege::Admin, 0, yield);
+ bus, netFn, cmd, 0, 0, 0, ipmi::Privilege::Admin, 0, yield);
auto request = std::make_shared<ipmi::message::Request>(
ctx, std::forward<std::vector<uint8_t>>(data));
ipmi::message::Response::ptr response =
OpenPOWER on IntegriCloud