diff options
author | Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> | 2018-09-21 12:28:57 +0530 |
---|---|---|
committer | Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> | 2018-11-13 15:41:17 +0530 |
commit | 42bed64d8e34d55bae9ab8fb395a00ce412dcd8e (patch) | |
tree | 0c23e93b2e101d018deb82561760c54202bdc39a /user_channel/user_layer.cpp | |
parent | b29b5ab3b9ad812949f3621a4422fde8d7c1c8d2 (diff) | |
download | phosphor-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.cpp | 17 |
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; } |