user_channel: Rewriting ipmiUserSetUserName API
Rewriting ipmiUserSetUserName API
Tested:
Verified using ipmitool commands.
Command: ipmitool user set name 4 user4
Response: //Success
Command: ipmitool user set password 4 asdf1234
Response: Set User Password command successful (user 4)
Command: ipmitool user priv 4 0x03 1
Response: Set Privilege Level command successful (user 4)
Command: ipmitool user set name 14 user13asdfghkjlqwert
Response: Username is too long (> 16 bytes)
Command: ipmitool -I lanplus -C 3 -p 623 -U root -P <password> -H
<BMC-IP> user set name 8 WIJGueNKd
Response: //Success
Command: ipmitool user list 1 //User list for channel 1
1 root false true true ADMINISTRATOR
2 user2 true false false USER
3 user3 true false false NO ACCESS
4 user4 true false false OPERATOR
5 WIJGueNK true false false NO ACCESS
6 WIJGueNKb true false false NO ACCESS
7 WIJGueNKc true false false NO ACCESS
8 WIJGueNKd true false false NO ACCESS
9 true false false NO ACCESS
10 true false false NO ACCESS
Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I41c091f6d9aaf54326295d1e80e16db521b2e23d
diff --git a/user_channel/user_mgmt.hpp b/user_channel/user_mgmt.hpp
index d77317a..20abda1 100644
--- a/user_channel/user_mgmt.hpp
+++ b/user_channel/user_mgmt.hpp
@@ -164,7 +164,7 @@
*
* @return true if valid, false otherwise
*/
- bool isValidUserName(const char* userNameInChar);
+ bool isValidUserName(const std::string& userName);
/** @brief determines whether ipmi is in available groups list
*
@@ -213,7 +213,7 @@
*
* @return ccSuccess for success, others for failure.
*/
- Cc setUserName(const uint8_t userId, const char* userNameInChar);
+ Cc setUserName(const uint8_t userId, const std::string& userName);
/** @brief to set user enabled state
*