Skip to content

Commit cd12f0a

Browse files
author
Andris Zeila
committed
.......PS. [DEV-2695] removed group/all access flags for fping temporary files
Merge in ZBX/zabbix from feature/DEV-2695-6.5 to master * commit 'cf07db1d5c2b8fe4a9de85fed22cf05035e08914': .......PS. [DEV-2695] remove group/all access flags when creating fping input file for testing fping features
2 parents 815b869 + cf07db1 commit cd12f0a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libs/zbxicmpping/icmpping.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static int get_fping_out(const char *fping, const char *address, char **out, cha
129129
int ret = FAIL, fd;
130130
sigset_t mask, orig_mask;
131131
char filename[MAX_STRING_LEN];
132+
mode_t mode;
132133

133134
if (FAIL == zbx_validate_hostname(address) && FAIL == zbx_is_supported_ip(address))
134135
{
@@ -137,7 +138,12 @@ static int get_fping_out(const char *fping, const char *address, char **out, cha
137138
}
138139

139140
zbx_snprintf(filename, sizeof(filename), "%s/%s_XXXXXX", config_icmpping->get_tmpdir(), progname);
140-
if (-1 == (fd = mkstemp(filename)))
141+
142+
mode = umask(077);
143+
fd = mkstemp(filename);
144+
umask(mode);
145+
146+
if (-1 == fd)
141147
{
142148
zbx_snprintf(error, max_error_len, "Cannot create temporary file \"%s\": %s", filename,
143149
zbx_strerror(errno));

0 commit comments

Comments
 (0)