safer macro

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-04-01 06:10:57 +01:00
parent e731893208
commit f90af15502
2 changed files with 12 additions and 6 deletions
+4
View File
@@ -699,6 +699,10 @@ mkhtemp_tmpfile_linux(int dirfd,
linked = 1; /* file created */
/* TODO: potential fd leak here.
* probably should only set *fd on successful
* return from this function (see below)
*/
if (fd_verify_dir_identity(dirfd, st_dir_first) < 0 ||
fstat(*fd = tmpfd, st) < 0 ||
secure_file(fd, st, st, O_APPEND, 1, 1, 0600) < 0)