From c9e3e6a01b0abe1557d17ca90406b983184eb704 Mon Sep 17 00:00:00 2001 From: Dmitry Bazhenov Date: Mon, 26 Oct 2015 15:29:46 +0500 Subject: [PATCH] ID:397 - Fixed picmg policy set command. 'picmg policy set' command uses too restrictive input values check which allow setting/clearing only the Activation Locked Bit (#0). This patch fixes the check to allow setting/clearing Deactivation Locked Bit (#1) as well. --- lib/ipmi_picmg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ipmi_picmg.c b/lib/ipmi_picmg.c index e2103b5..f47577e 100644 --- a/lib/ipmi_picmg.c +++ b/lib/ipmi_picmg.c @@ -751,21 +751,19 @@ ipmi_picmg_fru_activation_policy_set(struct ipmi_intf * intf, int argc, char ** if (is_fru_id(argv[0], &msg_data[1]) != 0) { return (-1); } - if (str2uchar(argv[1], &msg_data[2]) != 0 || msg_data[2] > 1) { + if (str2uchar(argv[1], &msg_data[2]) != 0 || msg_data[2] > 3) { /* FRU Lock Mask */ lprintf(LOG_ERR, "Given FRU Lock Mask '%s' is invalid.", argv[1]); return (-1); } - if (str2uchar(argv[2], &msg_data[3]) != 0 || msg_data[3] > 1) { + if (str2uchar(argv[2], &msg_data[3]) != 0 || msg_data[3] > 3) { /* FRU Act Policy */ lprintf(LOG_ERR, "Given FRU Activation Policy '%s' is invalid.", argv[2]); return (-1); } - msg_data[2]&= 0x03; - msg_data[3]&= 0x03; rsp = intf->sendrecv(intf, &req);