mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Utilities: Use default execpromises parameter to pledge(..)
This commit is contained in:
parent
4d0317ae7a
commit
af3751e4dd
Notes:
sideshowbarker
2024-07-17 14:28:35 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/af3751e4dd Pull-request: https://github.com/SerenityOS/serenity/pull/13496 Reviewed-by: https://github.com/awesomekling ✅
@ -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()) {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 };
|
||||
|
@ -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;
|
||||
|
@ -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())
|
||||
|
@ -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]);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user