SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,27 @@
add pledge(2) to "mutool draw"
Index: source/tools/mudraw.c
--- source/tools/mudraw.c.orig
+++ source/tools/mudraw.c
@@ -34,6 +34,8 @@
#include "mupdf/helpers/mu-threads.h"
#endif
+#include <errno.h>
+#include <unistd.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>
@@ -2135,6 +2137,12 @@ int mudraw_main(int argc, char **argv)
if (fz_optind == argc)
return usage();
+
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ {
+ fprintf(stderr, "pledge: %s\n", strerror(errno));
+ exit(1);
+ }
if (num_workers > 0)
{