nvmutil tmpdir: check world-writeable / sticky bits

must be world writeable and not have sticky bits

a bit theoretical, but we're also reading TMPDIR,
which could be anything

due to how this is called, it defaults back to /tmp
if null is returned, so itt's safe

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-18 04:49:22 +00:00
parent 21cd0b7a91
commit 3256c3fcb8
2 changed files with 11 additions and 3 deletions
+8
View File
@@ -28,6 +28,14 @@ int fchmod(int fd, mode_t mode);
#define OFF_RESET 1
#endif
#ifndef S_ISVTX
#define S_ISVTX 01000
#endif
#if defined(S_IFMT) && ((S_ISVTX & S_IFMT) != 0)
#error "Unexpected bit layout"
#endif
#ifndef MAX_ZERO_RW_RETRY
#define MAX_ZERO_RW_RETRY 5
#endif