diff options
Diffstat (limited to 'util/libreboot-utils/include/common.h')
| -rw-r--r-- | util/libreboot-utils/include/common.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/util/libreboot-utils/include/common.h b/util/libreboot-utils/include/common.h index b26448db..620e95b9 100644 --- a/util/libreboot-utils/include/common.h +++ b/util/libreboot-utils/include/common.h @@ -287,6 +287,11 @@ struct xfile { unsigned char bufcmp[GBE_BUF_SIZE]; /* compare gbe/tmp/reads */ unsigned char pad[GBE_WORK_SIZE]; /* the file that wouldn't die */ + + /* we later rename in-place, using old fd. renameat() */ + int dirfd; + char *base; + char *tmpbase; }; /* Command table, MAC address, files @@ -497,9 +502,9 @@ const char *getnvmprogname(void); /* libc hardening */ -int new_tmpfile(int *fd, char **path); -int new_tmpdir(int *fd, char **path); -int new_tmp_common(int *fd, char **path, int type); +int new_tmpfile(int *fd, char **path, char *tmpdir); +int new_tmpdir(int *fd, char **path, char *tmpdir); +int new_tmp_common(int *fd, char **path, int type, char *tmpdir); int mkhtemp_try_create(int dirfd, struct stat *st_dir_initial, char *fname_copy, @@ -508,6 +513,14 @@ int mkhtemp_try_create(int dirfd, int *fd, struct stat *st, int type); +int +mkhtemp_tmpfile_linux(int dirfd, + struct stat *st_dir_initial, + char *fname_copy, + char *p, + size_t xc, + int *fd, + struct stat *st); int mkhtemp(int *fd, struct stat *st, char *template, int dirfd, const char *fname, struct stat *st_dir_initial, int type); @@ -517,7 +530,8 @@ int world_writeable_and_sticky(const char *s, int same_dir(const char *a, const char *b); int tmpdir_policy(const char *path, int *allow_noworld_unsticky); -char *env_tmpdir(int always_sticky, char **tmpdir); +char *env_tmpdir(int always_sticky, char **tmpdir, + char *override_tmpdir); int secure_file(int *fd, struct stat *st, struct stat *expected, @@ -547,6 +561,7 @@ int mkdirat_on_eintr(int dirfd, const char *pathname, mode_t mode); int if_err(int condition, int errval); int if_err_sys(int condition); +char *lbgetprogname(char *argv0); /* asserts */ |
