Closed vien20010 closed 1 year ago
Phenomenon:
ipmiutil user set password fail when Set User Access command: Invalid data field in request
Root cause:
ipmiutil uses privilege of user configuration info which is result of GetUserInfo function
_ipmi_userset function ipmiutil-3.1.8/util/iuser.c
In GetUserInfo function, priv = responseData[3] of GET_USER_ACCESS command
GetUserInfo function ipmiutil-3.1.8/util/ilan.c
responseData[3] is 1 byte data which is defined in ipmi spec Table 22- Get User Access Command
ipmiutil use this byte to execute Set User Access Command. But Request Data of this command only use 4 LSB bits for privilege and 4 MSB bits is reserved (must be 0b0000). We can easily refer it in ipmi spec Table 22- Set User Access Command.
So using a whole byte 5 (responseData[3]) of Get User Access command for request data of Set User Access Command isn’t suitable. ipmiutil should use only 4 LSB bits.
Solution: Use only 4 LSB bits in GetUserInfo function
Yes. The change on line 1007 is the right fix in ilan.c, thank you for your detailed research.
upriv = responseData[3] & 0x0F;
Step to reproduce: Create new user with ipmiutil command
Expected result: Command response success when setting account password
Actual result: Command return error when setting account password