commit 00eafcc9ccf6552f219901646badf44193204b93
parent 6a8a2ebef17f8e9df20cd9e4f285be87e108b180
Author: Frederic Cambus <fred@statdns.com>
Date: Sat, 26 Oct 2019 21:58:02 +0200
Move pledge and seccomp initialization before ansilove_init().
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/ansilove.c b/src/ansilove.c
@@ -89,9 +89,6 @@ main(int argc, char *argv[])
const char *errstr;
- if (ansilove_init(&ctx, &options) == -1)
- errx(EXIT_FAILURE, "%s", ansilove_error(&ctx));
-
if (pledge("stdio cpath rpath wpath", NULL) == -1)
err(EXIT_FAILURE, "pledge");
@@ -100,6 +97,9 @@ main(int argc, char *argv[])
prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &ansilove);
#endif
+ if (ansilove_init(&ctx, &options) == -1)
+ errx(EXIT_FAILURE, "%s", ansilove_error(&ctx));
+
while ((getoptFlag = getopt(argc, argv, "b:c:df:him:o:qrR:sv")) != -1) {
switch (getoptFlag) {
case 'b':