11
29
Fork
You've already forked ipmitool
33

Editing FRU if the length of the field is not equal the original field will return EXIT_FAILURE #81

Closed
opened 2026年03月04日 16:22:07 +01:00 by CrazyCat · 1 comment

I think it's a bug

When editing FRU, if the length of the field being modified does not match the original field, "ipmi_fru_set_field_string_rebuild" will be executed. This function returns 1 if successfully, yet the current logic sets rc= -1, resulting in the ipmitool command returning EXIT_FAILURE as its exit code.

Please see the code in ipmitool/lib/ipmi_fru.c:
image

I if "ipmi_fru_set_field_string_rebuild" returns 1, rc will be set 1

I think it's a bug When editing FRU, if the length of the field being modified does not match the original field, "**_ipmi_fru_set_field_string_rebuild_**" will be executed. This function returns 1 if successfully, yet the current logic sets **_rc= -1_**, resulting in the ipmitool command returning _EXIT_FAILURE_ as its exit code. Please see the code in _ipmitool/lib/ipmi_fru.c_: ![image](/attachments/6087e303-b648-4cee-9f42-ddf91110d0bf) I if "**_ipmi_fru_set_field_string_rebuild_**" returns 1, rc will be set 1

Thanks for the catch. This should be fixed in #82.

Nonetheless, I strongly recommend using https://codeberg.org/IPMITool/frugen for FRU modification, as it is much more versatile and flexible, plus it better supports the FRU specification.

You can use ipmitool fru read to read the binary file, then modify it with frugen, then write it back with ipmitool fru write.

Probably, at some point in the future I will bring libfru from frugen to ipmitool to replace the currently existing fru handling code, because to be honest, the currently existing code here is quite dirty.

Thanks for the catch. This should be fixed in #82. Nonetheless, I strongly recommend using https://codeberg.org/IPMITool/frugen for FRU modification, as it is much more versatile and flexible, plus it better supports the FRU specification. You can use `ipmitool fru read` to read the binary file, then modify it with `frugen`, then write it back with `ipmitool fru write`. Probably, at some point in the future I will bring `libfru` from `frugen` to `ipmitool` to replace the currently existing fru handling code, because to be honest, the currently existing code here is quite dirty.
Sign in to join this conversation.
No Branch/Tag specified
master
bugfix/43-Fix-timezone-and-DST-in-SEL
pages
bugfix/fix-ci-builds
feature/refactor-sdr-name-handling
cleanup/nm
feature/add-support-for-boot-mailbox
codefactor
bugfix/26
IPMITOOL_1_8_19
IPMITOOL_1_8_18
IPMITOOL_1_8_17
IPMITOOL_1_8_16
IPMITOOL_1_8_15
IPMITOOL_1_8_15RC1
IPMITOOL_1_8_14
IPMITOOL_1_8_14RC2
IPMITOOL_1_8_14RC1
ipmitool
IPMITOOL_1_8_13
IPMITOOL_1_8_13RC1
IPMITOOL_1_8_12
IPMITOOL_1_8_9
IPMITOOL_1_8_8
IPMITOOL_1_8_7
IPMITOOL_1_8_6
IPMITOOL_1_8_5
IPMITOOL_1_8_0
IPMITOOL_S10_U1
IPMITOOL_1_6_1
IPMITOOL_1_6_0
IPMITOOL_1_5_9
IPMITOOL_1_5_8
IPMITOOL_1_5_7
IPMITOOL_1_5_6
IPMITOOL_1_5_4
IPMITOOL_1_4_1_1
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IPMITool/ipmitool#81
Reference in a new issue
IPMITool/ipmitool
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?