mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
util/nvmutil: initialise st in tmpdir
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -2999,10 +2999,14 @@ x_c_tmpdir(void)
|
|||||||
char *t;
|
char *t;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
|
t = getenv("TMPDIR");
|
||||||
t = getenv("TMPDIR");
|
t = getenv("TMPDIR");
|
||||||
if (t && *t) {
|
if (t && *t) {
|
||||||
if ((st.st_mode & S_IWOTH) && !(st.st_mode & S_ISVTX))
|
if (stat(t, &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||||
return NULL;
|
if ((st.st_mode & S_IWOTH) && !(st.st_mode & S_ISVTX))
|
||||||
|
return NULL;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stat("/tmp", &st) == 0 && S_ISDIR(st.st_mode))
|
if (stat("/tmp", &st) == 0 && S_ISDIR(st.st_mode))
|
||||||
|
|||||||
Reference in New Issue
Block a user