diff --git a/ipmitool/lib/helper.c b/ipmitool/lib/helper.c index e68f1b0..7e54ba7 100644 --- a/ipmitool/lib/helper.c +++ b/ipmitool/lib/helper.c @@ -398,8 +398,10 @@ ipmi_start_daemon(void) chdir("/"); umask(0); +#if 0 for (fd=0; fd<64; fd++) close(fd); +#endif open("/dev/null", O_RDWR); dup(0); diff --git a/ipmitool/lib/ipmi_user.c b/ipmitool/lib/ipmi_user.c index a1f2d30..ca746ff 100644 --- a/ipmitool/lib/ipmi_user.c +++ b/ipmitool/lib/ipmi_user.c @@ -349,18 +349,20 @@ ipmi_user_set_userpriv( { struct ipmi_rs *rsp; struct ipmi_rq req; - uint8_t msg_data[3]; + uint8_t msg_data[4]; memset(&req, 0, sizeof(req)); req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */ req.msg.cmd = IPMI_SET_USER_ACCESS; /* 0x43 */ req.msg.data = msg_data; - req.msg.data_len = 3; + req.msg.data_len = 4; /* The channel number will remain constant throughout this function */ - msg_data[0] = (channel & 0x0f); /* Do not change any bytes */ + msg_data[0] = (channel & 0x0f); + msg_data[0] |= 0x90; /* enable ipmi messaging */ msg_data[1] = (user_id & 0x3f); msg_data[2] = (privLevel & 0x0f); + msg_data[3] = 0; rsp = intf->sendrecv(intf, &req); @@ -372,8 +374,8 @@ ipmi_user_set_userpriv( } if (rsp->ccode > 0) { - lprintf(LOG_ERR, "Set Privilege Level command failed (user %d)", - user_id); + lprintf(LOG_ERR, "Set Privilege Level command failed (user %d): %s", + user_id, val2str(rsp->ccode, completion_code_vals)); return -1; } @@ -492,7 +494,7 @@ print_user_usage(void) lprintf(LOG_NOTICE, " set password []"); lprintf(LOG_NOTICE, " disable "); lprintf(LOG_NOTICE, " enable "); - lprintf(LOG_NOTICE, " priv []"); + lprintf(LOG_NOTICE, " priv []"); lprintf(LOG_NOTICE, " test <16|20> [\n"); }