From 05e772d276cd8ee3c6256003ac7f097322843716 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 11 Feb 2020 12:16:07 +0100 Subject: [PATCH] jp: Use pledge() --- Userland/jp.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Userland/jp.cpp b/Userland/jp.cpp index b11076367f..75f8df2ab5 100644 --- a/Userland/jp.cpp +++ b/Userland/jp.cpp @@ -30,6 +30,7 @@ #include #include #include +#include static void print(const JsonValue& value, int indent = 0); static void print_indent(int indent) @@ -40,6 +41,11 @@ static void print_indent(int indent) int main(int argc, char** argv) { + if (pledge("stdio rpath", nullptr) < 0) { + perror("pledge"); + return 1; + } + if (argc != 2) { fprintf(stderr, "usage: jp \n"); return 0; @@ -50,6 +56,11 @@ int main(int argc, char** argv) return 1; } + if (pledge("stdio", nullptr) < 0) { + perror("pledge"); + return 1; + } + auto file_contents = file->read_all(); auto json = JsonValue::from_string(file_contents);