mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
Remove ipmi_user_set_password()
Commit removes ipmi_user_set_password() as it's not being used anywhere.
This commit is contained in:
parent
90e2134413
commit
8f1f31cfdc
@ -388,60 +388,6 @@ ipmi_user_set_username(
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_user_set_password
|
||||
*
|
||||
* This function is responsible for 4 things
|
||||
* Enabling/Disabling users
|
||||
* Setting/Testing passwords
|
||||
*/
|
||||
static int
|
||||
ipmi_user_set_password(struct ipmi_intf *intf, uint8_t user_id,
|
||||
uint8_t operation, const char *password,
|
||||
uint8_t is_twenty_byte_password)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[22];
|
||||
|
||||
int password_length = (is_twenty_byte_password? 20 : 16);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
|
||||
req.msg.cmd = IPMI_SET_USER_PASSWORD; /* 0x47 */
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = password_length + 2;
|
||||
|
||||
|
||||
/* The channel number will remain constant throughout this function */
|
||||
msg_data[0] = user_id;
|
||||
|
||||
if (is_twenty_byte_password)
|
||||
msg_data[0] |= 0x80;
|
||||
|
||||
msg_data[1] = operation;
|
||||
|
||||
memset(msg_data + 2, 0, password_length);
|
||||
|
||||
if (password != NULL)
|
||||
strncpy((char *)(msg_data + 2), password, password_length);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Set User Password command failed (user %d)",
|
||||
user_id);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set User Password command failed (user %d): %s",
|
||||
user_id, val2str(rsp->ccode, completion_code_vals));
|
||||
return rsp->ccode;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ipmi_user_test_password - Call _ipmi_set_user_password() with operation bit
|
||||
* set to test password and interpret result.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user