mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-07-03 18:51:42 +00:00
add cleanup function to clear sdr cache,
zero password field when setting
This commit is contained in:
@@ -150,6 +150,7 @@ void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password)
|
|||||||
intf->session->password = 0;
|
intf->session->password = 0;
|
||||||
if (password) {
|
if (password) {
|
||||||
intf->session->password = 1;
|
intf->session->password = 1;
|
||||||
|
memset(intf->session->authcode, 0, IPMI_AUTHCODE_BUFFER_SIZE);
|
||||||
memcpy(intf->session->authcode,
|
memcpy(intf->session->authcode,
|
||||||
password,
|
password,
|
||||||
min(strlen(password), IPMI_AUTHCODE_BUFFER_SIZE));
|
min(strlen(password), IPMI_AUTHCODE_BUFFER_SIZE));
|
||||||
@@ -174,3 +175,8 @@ void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, unsigned char autht
|
|||||||
if (intf && intf->session)
|
if (intf && intf->session)
|
||||||
intf->session->authtype_set = authtype;
|
intf->session->authtype_set = authtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ipmi_cleanup(struct ipmi_intf * intf)
|
||||||
|
{
|
||||||
|
ipmi_sdr_list_empty(intf);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user