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:
Leah Rowe
2026-03-23 10:51:02 +00:00
parent ba80191b78
commit a9165d2503

View File

@@ -453,16 +453,20 @@ env_tmpdir(int bypass_all_sticky_checks)
if (t != NULL && *t != '\0') {
if (tmpdir_policy(t,
&allow_noworld_unsticky) == 0) {
if (world_writeable_and_sticky(t,
allow_noworld_unsticky,
bypass_all_sticky_checks)) {
errno = saved_errno;
return t;
}
&allow_noworld_unsticky) < 0) {
errno = EPERM;
return NULL; /* errno already set */
}
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;