mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
mkhtemp: fail if TMPDIR is SET, but set wrong
right now we defer to fallbacks otherwise, which is wrong. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -453,17 +453,21 @@ env_tmpdir(int bypass_all_sticky_checks)
|
||||
if (t != NULL && *t != '\0') {
|
||||
|
||||
if (tmpdir_policy(t,
|
||||
&allow_noworld_unsticky) == 0) {
|
||||
&allow_noworld_unsticky) < 0) {
|
||||
errno = EPERM;
|
||||
return NULL; /* errno already set */
|
||||
}
|
||||
|
||||
if (world_writeable_and_sticky(t,
|
||||
if (!world_writeable_and_sticky(t,
|
||||
allow_noworld_unsticky,
|
||||
bypass_all_sticky_checks)) {
|
||||
errno = EPERM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
errno = saved_errno;
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
allow_noworld_unsticky = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user