summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2018-11-28 20:42:25 +0530
committerRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2018-12-18 02:03:07 +0000
commit02710bb19487b482f73e9eff81f3cc5621254db5 (patch)
tree469b2e88c86010d76d06f9084fc009e0212523b1
parent8b18941da3add5edb2687627f6cf9db8b19d11f6 (diff)
downloadphosphor-host-ipmid-02710bb19487b482f73e9eff81f3cc5621254db5.tar.gz
phosphor-host-ipmid-02710bb19487b482f73e9eff81f3cc5621254db5.zip
Create / delete user with proper properties
Fixed code to create the user with default user properties and clean-up the properties properly, when the user name is cleared. Unit-Test: Verified that during Set User name, user is created with default properties and user info in ipmi is fully cleaned during user delete. Change-Id: I5060fc9f3dd1b98adb43fd7560a9e742ce484fcb Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
-rw-r--r--user_channel/user_mgmt.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index 641abf0..eb95163 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -798,10 +798,7 @@ ipmi_ret_t UserAccess::setUserName(const uint8_t userId,
entry("PATH=%s", userPath.c_str()));
return IPMI_CC_UNSPECIFIED_ERROR;
}
- std::fill(userInfo->userName,
- userInfo->userName + sizeof(userInfo->userName), 0);
- ipmiClearUserEntryPassword(oldUser);
- userInfo->userInSystem = false;
+ deleteUserIndex(userId);
}
else if (oldUser.empty() && !newUser.empty() && validUser)
{
@@ -811,10 +808,7 @@ ipmi_ret_t UserAccess::setUserName(const uint8_t userId,
auto method = bus.new_method_call(
getUserServiceName().c_str(), userMgrObjBasePath,
userMgrInterface, createUserMethod);
- // TODO: Fetch proper privilege & enable state once set User access
- // is implemented if LAN Channel specified, then create user for all
- // groups follow channel privilege for user creation.
- method.append(newUser.c_str(), availableGroups, "priv-admin", true);
+ method.append(newUser.c_str(), availableGroups, "", false);
auto reply = bus.call(method);
}
catch (const sdbusplus::exception::SdBusError& e)
OpenPOWER on IntegriCloud