1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 07:13:36 +02:00

replace pledge "stdio rpath tmppath" with unveil "/tmp" "rwc" to satisfy

mktemp(3) type operations, unveil "/" "r" for reading all over the tree,
and pledge "stdio rpath wpath cpath" to permit both unveils subject to
their own limitations.
This commit is contained in:
deraadt
2026-02-23 16:45:16 +00:00
parent 1b5c1c8cc4
commit 3ae6636769
+5 -1
View File
@@ -2962,7 +2962,11 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
if (pledge ("stdio rpath tmppath", NULL) == -1)
if (unveil ("/tmp", "rwc") == -1)
fatal (_("Failed to unveil /tmp"));
if (unveil ("/", "r") == -1)
fatal (_("Failed to unveil /"));
if (pledge ("stdio rpath wpath cpath", NULL) == -1)
fatal (_("Failed to pledge"));
program_name = *argv;