summaryrefslogtreecommitdiffstats
path: root/user_channel/user_layer.cpp
diff options
context:
space:
mode:
authorRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2018-09-21 12:28:57 +0530
committerRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2018-11-13 15:41:17 +0530
commit42bed64d8e34d55bae9ab8fb395a00ce412dcd8e (patch)
tree0c23e93b2e101d018deb82561760c54202bdc39a /user_channel/user_layer.cpp
parentb29b5ab3b9ad812949f3621a4422fde8d7c1c8d2 (diff)
downloadphosphor-host-ipmid-42bed64d8e34d55bae9ab8fb395a00ce412dcd8e.tar.gz
phosphor-host-ipmid-42bed64d8e34d55bae9ab8fb395a00ce412dcd8e.zip
IPMI password entry cleanup
Whenever user is removed from the system, password map in IPMI database has to be cleaned up. Similarly password entry must be updated when user rename happens. This commit add's API changes for the same Change-Id: I304c721b31fc7fbad019c85d8ca2ecc60ca398d8 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Diffstat (limited to 'user_channel/user_layer.cpp')
-rw-r--r--user_channel/user_layer.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/user_channel/user_layer.cpp b/user_channel/user_layer.cpp
index ed99137..06cdd68 100644
--- a/user_channel/user_layer.cpp
+++ b/user_channel/user_layer.cpp
@@ -29,9 +29,22 @@ std::string ipmiUserGetPassword(const std::string& userName)
return passwdMgr.getPasswdByUserName(userName);
}
-ipmi_ret_t ipmiUserClearPassword(const std::string& userName)
+ipmi_ret_t ipmiClearUserEntryPassword(const std::string& userName)
{
- passwdMgr.clearUserEntry(userName);
+ if (passwdMgr.updateUserEntry(userName, "") != 0)
+ {
+ return IPMI_CC_UNSPECIFIED_ERROR;
+ }
+ return IPMI_CC_OK;
+}
+
+ipmi_ret_t ipmiRenameUserEntryPassword(const std::string& userName,
+ const std::string& newUserName)
+{
+ if (passwdMgr.updateUserEntry(userName, newUserName) != 0)
+ {
+ return IPMI_CC_UNSPECIFIED_ERROR;
+ }
return IPMI_CC_OK;
}
OpenPOWER on IntegriCloud