mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
mkhtemp: harden tmpdir access control
faccessat used this way respects uid/gid, handles ACLs (where used), and matches whatt many real security tools might do. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -475,6 +475,12 @@ world_writeable_and_sticky(
|
||||
goto sticky_hell; /* not sticky */
|
||||
}
|
||||
|
||||
/* if anyone even looks at you funny, drop
|
||||
* everything on the floor and refuse to function
|
||||
*/
|
||||
if (faccessat(dirfd, ".", X_OK, AT_EACCESS) < 0)
|
||||
goto sticky_hell;
|
||||
|
||||
/* non-world-writeable, so
|
||||
* stickiness is do-not-care
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user