bsnmp: Use mkstemp when creating clients local socket
Reviewed by: harti, rew Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #72 Differential Revision: https://reviews.freebsd.org/D34550
This commit is contained in:
parent
80c3eb7bc6
commit
81e0e7b9e3
@ -1012,7 +1012,7 @@ open_client_local(const char *path)
|
|||||||
snprintf(snmp_client.local_path, sizeof(snmp_client.local_path),
|
snprintf(snmp_client.local_path, sizeof(snmp_client.local_path),
|
||||||
"%s", SNMP_LOCAL_PATH);
|
"%s", SNMP_LOCAL_PATH);
|
||||||
|
|
||||||
if (mktemp(snmp_client.local_path) == NULL) {
|
if (mkstemp(snmp_client.local_path) == -1) {
|
||||||
seterr(&snmp_client, "%s", strerror(errno));
|
seterr(&snmp_client, "%s", strerror(errno));
|
||||||
(void)close(snmp_client.fd);
|
(void)close(snmp_client.fd);
|
||||||
snmp_client.fd = -1;
|
snmp_client.fd = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user