Menu

#485 IPMI command failed: Invalid data field in request Set User Password command failed (user 16)

version-1.8.18
open
nobody
5
2017-09-04
2017-05-18
No

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);
}

req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = IPMI_SET_USER_PASSWORD;
req.msg.data = data;
req.msg.data_len = data_len;
rsp = intf->sendrecv(intf, &req);
free(data);
data = NULL;
if (rsp == NULL) {
    return (-1);
}
return rsp->ccode;

}

Discussion

  • mareedu srinivasa rao

    Hi Maintainer,

    Please find the patch for bug.

    Br,
    MSR

     

    Last edit: mareedu srinivasa rao 2017-06-06
  • mareedu srinivasa rao

    Hi Z,

    can i get any update on this.

    Br,
    MSR

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.