Browse Source

Utilities: Use default execpromises parameter to `pledge(..)`

Brian Gianforcaro 3 năm trước cách đây
mục cha
commit
af3751e4dd

+ 1 - 1
Userland/Utilities/abench.cpp

@@ -30,7 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
 
     TRY(Core::System::unveil(Core::File::absolute_path(path), "r"));
     TRY(Core::System::unveil(nullptr, nullptr));
-    TRY(Core::System::pledge("stdio recvfd rpath", nullptr));
+    TRY(Core::System::pledge("stdio recvfd rpath"));
 
     auto maybe_loader = Audio::Loader::create(path);
     if (maybe_loader.is_error()) {

+ 1 - 1
Userland/Utilities/asctl.cpp

@@ -43,7 +43,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
     args_parser.parse(arguments);
 
     TRY(Core::System::unveil(nullptr, nullptr));
-    TRY(Core::System::pledge("stdio rpath wpath recvfd", nullptr));
+    TRY(Core::System::pledge("stdio rpath wpath recvfd"));
 
     if (command.equals_ignoring_case("get") || command == "g") {
         // Get variables

+ 1 - 1
Userland/Utilities/checksum.cpp

@@ -14,7 +14,7 @@
 
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
-    TRY(Core::System::pledge("stdio rpath", nullptr));
+    TRY(Core::System::pledge("stdio rpath"));
 
     auto program_name = LexicalPath::basename(arguments.strings[0]);
     auto hash_kind = Crypto::Hash::HashKind::None;

+ 1 - 1
Userland/Utilities/chgrp.cpp

@@ -13,7 +13,7 @@
 
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
-    TRY(Core::System::pledge("stdio rpath chown", nullptr));
+    TRY(Core::System::pledge("stdio rpath chown"));
 
     char const* gid_arg = nullptr;
     char const* path = nullptr;

+ 1 - 1
Userland/Utilities/chown.cpp

@@ -18,7 +18,7 @@
 
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
-    TRY(Core::System::pledge("stdio rpath chown", nullptr));
+    TRY(Core::System::pledge("stdio rpath chown"));
 
     String spec;
     String path;

+ 1 - 1
Userland/Utilities/clear.cpp

@@ -10,7 +10,7 @@
 
 ErrorOr<int> serenity_main(Main::Arguments)
 {
-    TRY(Core::System::pledge("stdio", nullptr));
+    TRY(Core::System::pledge("stdio"));
     printf("\033[3J\033[H\033[2J");
     fflush(stdout);
     return 0;

+ 1 - 1
Userland/Utilities/comm.cpp

@@ -18,7 +18,7 @@
 
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
-    TRY(Core::System::pledge("stdio rpath", nullptr));
+    TRY(Core::System::pledge("stdio rpath"));
 
     String file1_path, file2_path;
     bool suppress_col1 { false };

+ 1 - 1
Userland/Utilities/date.cpp

@@ -13,7 +13,7 @@
 
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
-    TRY(Core::System::pledge("stdio settime rpath", nullptr));
+    TRY(Core::System::pledge("stdio settime rpath"));
 
     bool print_unix_date = false;
     bool print_iso_8601 = false;

+ 2 - 2
Userland/Utilities/gml-format.cpp

@@ -49,7 +49,7 @@ ErrorOr<bool> format_file(StringView path, bool inplace)
 ErrorOr<int> serenity_main(Main::Arguments args)
 {
 #ifdef __serenity__
-    TRY(Core::System::pledge("stdio rpath wpath cpath", nullptr));
+    TRY(Core::System::pledge("stdio rpath wpath cpath"));
 #endif
 
     bool inplace = false;
@@ -63,7 +63,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
 
 #ifdef __serenity__
     if (!inplace)
-        TRY(Core::System::pledge("stdio rpath", nullptr));
+        TRY(Core::System::pledge("stdio rpath"));
 #endif
 
     if (files.is_empty())

+ 1 - 1
Userland/Utilities/grep.cpp

@@ -35,7 +35,7 @@ void fail(StringView format, Ts... args)
 
 ErrorOr<int> serenity_main(Main::Arguments args)
 {
-    TRY(Core::System::pledge("stdio rpath", nullptr));
+    TRY(Core::System::pledge("stdio rpath"));
 
     String program_name = AK::LexicalPath::basename(args.strings[0]);
 

+ 1 - 1
Userland/Utilities/groups.cpp

@@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
     TRY(Core::System::unveil("/etc/passwd", "r"));
     TRY(Core::System::unveil("/etc/group", "r"));
     TRY(Core::System::unveil(nullptr, nullptr));
-    TRY(Core::System::pledge("stdio rpath", nullptr));
+    TRY(Core::System::pledge("stdio rpath"));
 
     Vector<char const*> usernames;
 

+ 1 - 1
Userland/Utilities/head.cpp

@@ -18,7 +18,7 @@ int head(String const& filename, bool print_filename, ssize_t line_count, ssize_
 
 ErrorOr<int> serenity_main(Main::Arguments args)
 {
-    TRY(Core::System::pledge("stdio rpath", nullptr));
+    TRY(Core::System::pledge("stdio rpath"));
 
     int line_count = -1;
     int byte_count = -1;

+ 1 - 1
Userland/Utilities/host.cpp

@@ -14,7 +14,7 @@
 
 ErrorOr<int> serenity_main(Main::Arguments args)
 {
-    TRY(Core::System::pledge("stdio unix", nullptr));
+    TRY(Core::System::pledge("stdio unix"));
 
     char const* name_or_ip = nullptr;
     Core::ArgsParser args_parser;

+ 2 - 2
Userland/Utilities/less.cpp

@@ -524,7 +524,7 @@ static void cat_file(FILE* file)
 
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
-    TRY(Core::System::pledge("stdio rpath tty sigaction", nullptr));
+    TRY(Core::System::pledge("stdio rpath tty sigaction"));
 
     char const* filename = "-";
     char const* prompt = "?f%f :.(line %l)?e (END):.";
@@ -557,7 +557,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
         g_resized = true;
     });
 
-    TRY(Core::System::pledge("stdio tty", nullptr));
+    TRY(Core::System::pledge("stdio tty"));
 
     if (emulate_more) {
         // Configure options that match more's behavior

+ 1 - 1
Userland/Utilities/sleep.cpp

@@ -34,7 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
     sa.sa_handler = handle_sigint;
     sigaction(SIGINT, &sa, nullptr);
 
-    TRY(Core::System::pledge("stdio sigaction", nullptr));
+    TRY(Core::System::pledge("stdio sigaction"));
 
     double whole_seconds = static_cast<time_t>(secs);
     double fraction = secs - whole_seconds;

+ 1 - 1
Userland/Utilities/stat.cpp

@@ -88,7 +88,7 @@ static ErrorOr<int> stat(StringView file, bool should_follow_links)
 
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
-    TRY(Core::System::pledge("stdio rpath", nullptr));
+    TRY(Core::System::pledge("stdio rpath"));
 
     bool should_follow_links = false;
     Vector<StringView> files;

+ 2 - 2
Userland/Utilities/watch.cpp

@@ -110,7 +110,7 @@ static int run_command(Vector<char const*> const& command)
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
     TRY(Core::System::signal(SIGINT, handle_signal));
-    TRY(Core::System::pledge("stdio proc exec rpath", nullptr));
+    TRY(Core::System::pledge("stdio proc exec rpath"));
 
     Vector<String> files_to_watch;
     Vector<char const*> command;
@@ -184,7 +184,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
             }
         }
     } else {
-        TRY(Core::System::pledge("stdio proc exec", nullptr));
+        TRY(Core::System::pledge("stdio proc exec"));
 
         struct timeval interval;
         if (opt_interval <= 0) {

+ 1 - 1
Userland/Utilities/xargs.cpp

@@ -40,7 +40,7 @@ private:
 
 ErrorOr<int> serenity_main(Main::Arguments main_arguments)
 {
-    TRY(Core::System::pledge("stdio rpath proc exec", nullptr));
+    TRY(Core::System::pledge("stdio rpath proc exec"));
 
     char const* placeholder = nullptr;
     bool split_with_nulls = false;