use pledge(2) in regression tests
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
diff --git a/regress/delta/delta_test.c b/regress/delta/delta_test.c
index f6edbe0..1567c43 100644
--- a/regress/delta/delta_test.c
+++ b/regress/delta/delta_test.c
@@ -19,6 +19,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <err.h>
+#include <unistd.h>
#include "got_error.h"
@@ -108,6 +110,9 @@ main(int argc, const char *argv[])
return 1;
}
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
+
RUN_TEST(delta_apply(), "delta_apply");
return failure ? 1 : 0;
diff --git a/regress/repository/repository_test.c b/regress/repository/repository_test.c
index 1d2959d..c986d41 100644
--- a/regress/repository/repository_test.c
+++ b/regress/repository/repository_test.c
@@ -22,6 +22,8 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <err.h>
+#include <unistd.h>
#include "got_error.h"
#include "got_object.h"
@@ -405,6 +407,9 @@ main(int argc, char *argv[])
const char *repo_path;
int ch;
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
+
while ((ch = getopt(argc, argv, "v")) != -1) {
switch (ch) {
case 'v':
diff --git a/regress/worktree/worktree_test.c b/regress/worktree/worktree_test.c
index 84ee710..eca73fe 100644
--- a/regress/worktree/worktree_test.c
+++ b/regress/worktree/worktree_test.c
@@ -26,6 +26,8 @@
#include <unistd.h>
#include <errno.h>
#include <util.h>
+#include <err.h>
+#include <unistd.h>
#include "got_error.h"
#include "got_object.h"
@@ -381,6 +383,9 @@ main(int argc, char *argv[])
const char *repo_path;
int ch;
+ if (pledge("stdio rpath wpath cpath flock", NULL) == -1)
+ err(1, "pledge");
+
while ((ch = getopt(argc, argv, "v")) != -1) {
switch (ch) {
case 'v':