You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is bug found while creating user by using ipmitool.
when tool try ot set password for user id == 16, it will always fails for user id 16.
the error which i am getting is
'Compl Code : 0xcc
IPMI command failed: Invalid data field in request
Set User Password command failed (user 16)'
Also have identified from the in the code from (highlited code) causing the issue. Masking of LSB bits will setting to all zeros in MSB bits by 0x0F. This will set 4th bit as zero for user id 16. finally user id will send in this function is 0.
We have to modify this masking as data[0] |= (0x7F & userid); this is the fix for this issue. Can you change code accordingly.
Reported by: mareedu srinivasa rao
Original Ticket: ipmitool/bugs/485
Hi IPMITOOL Maintainer,
There is bug found while creating user by using ipmitool.
when tool try ot set password for user id == 16, it will always fails for user id 16.
the error which i am getting is
'Compl Code : 0xcc
IPMI command failed: Invalid data field in request
Set User Password command failed (user 16)'
Also have identified from the in the code from (highlited code) causing the issue. Masking of LSB bits will setting to all zeros in MSB bits by 0x0F. This will set 4th bit as zero for user id 16. finally user id will send in this function is 0.
We have to modify this masking as data[0] |= (0x7F & userid); this is the fix for this issue. Can you change code accordingly.
int
_ipmi_set_user_password(struct ipmi_intf *intf, uint8_t user_id,
uint8_t operation, const char *password,
uint8_t is_twenty_byte)
{
struct ipmi_rq req = {0};
struct ipmi_rs *rsp;
uint8_t *data;
uint8_t data_len = (is_twenty_byte) ? 22 : 18;
data = malloc(sizeof(uint8_t) * data_len);
if (data == NULL) {
return (-4);
}
memset(data, 0, data_len);
data[0] = (is_twenty_byte) ? 0x80 : 0x00;
data[0] |= (0x0F & user_id);
data[1] = 0x03 & operation;
if (password != NULL) {
size_t copy_len = strlen(password);
if (copy_len > (data_len - 2)) {
copy_len = data_len - 2;
} else if (copy_len < 1) {
copy_len = 0;
}
strncpy((char *)(data + 2), password, copy_len);
}
}
The text was updated successfully, but these errors were encountered: