mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
@@ -826,12 +826,14 @@ close_on_eintr(int *fd)
|
||||
* ONE MACRO TO RULE THEM ALL:
|
||||
*/
|
||||
#define fs_err_retry() \
|
||||
do { \
|
||||
if ((rval == -1) && \
|
||||
(errno == EINTR)) \
|
||||
return 1; \
|
||||
if (rval >= 0 && !errno) \
|
||||
errno = saved_errno; \
|
||||
return 0
|
||||
return 0; \
|
||||
} while(0)
|
||||
/*
|
||||
* Regarding the errno logic above:
|
||||
* on success, it is permitted that
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user