Skip to content

Commit 7164855

Browse files
committed
hardened file permissions
Signed-off-by: dietWall <dietrich7@gmx.de>
1 parent b08cc3b commit 7164855

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/flb_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ static int machine_id_read_and_sanitize(char *path,
20432043
return 0;
20442044
}
20452045

2046-
int write_uuid_to_file(char* filename, char* uuid)
2046+
static int write_uuid_to_file(const char* filename, char* uuid)
20472047
{
20482048
int fd;
20492049
size_t uuid_len;
@@ -2053,7 +2053,7 @@ int write_uuid_to_file(char* filename, char* uuid)
20532053
}
20542054

20552055
/* write uuid to file */
2056-
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0666);
2056+
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0600);
20572057
if (fd == -1) {
20582058
return FLB_FALSE;
20592059
}

0 commit comments

Comments
 (0)