mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:47:34 +00:00
Everywhere: Use default execpromises argument for Core::System::pledge
This commit is contained in:
parent
44ffe3e5bb
commit
cf4fa936be
87 changed files with 132 additions and 132 deletions
|
@ -25,7 +25,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath tty", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath tty"));
|
||||
TRY(Core::System::unveil("/proc/net/arp", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
|
||||
bool decode = false;
|
||||
const char* filepath = nullptr;
|
||||
|
@ -43,7 +43,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
buffer = file->read_all();
|
||||
}
|
||||
|
||||
TRY(Core::System::pledge("stdio", nullptr));
|
||||
TRY(Core::System::pledge("stdio"));
|
||||
|
||||
if (decode) {
|
||||
auto decoded = decode_base64(StringView(buffer));
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio", nullptr));
|
||||
TRY(Core::System::pledge("stdio"));
|
||||
|
||||
StringView path;
|
||||
StringView suffix;
|
||||
|
|
|
@ -26,7 +26,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
{
|
||||
TRY(Core::System::unveil("/dev", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
|
||||
const char* device = nullptr;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
auto hostname = TRY(Core::System::gethostname());
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
|
||||
Vector<StringView> paths;
|
||||
|
||||
|
@ -43,7 +43,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
}
|
||||
}
|
||||
|
||||
TRY(Core::System::pledge("stdio", nullptr));
|
||||
TRY(Core::System::pledge("stdio"));
|
||||
|
||||
Array<u8, 32768> buffer;
|
||||
for (auto& fd : fds) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath fattr chown", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath fattr chown"));
|
||||
|
||||
bool link = false;
|
||||
bool preserve = false;
|
||||
|
@ -36,7 +36,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (preserve) {
|
||||
umask(0);
|
||||
} else {
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath fattr", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath fattr"));
|
||||
}
|
||||
|
||||
bool destination_is_existing_dir = Core::File::is_directory(destination);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
TRY(Core::System::unveil("/proc/dmesg", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ static String interpret_backslash_escapes(StringView string, bool& no_trailing_n
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio", nullptr));
|
||||
TRY(Core::System::pledge("stdio"));
|
||||
|
||||
Vector<const char*> text;
|
||||
bool no_trailing_newline = false;
|
||||
|
|
|
@ -28,7 +28,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"));
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_option(flag_print_uid, "Print UID", nullptr, 'u');
|
||||
|
|
|
@ -1158,7 +1158,7 @@ public:
|
|||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
#ifdef __serenity__
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath tty sigaction", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath tty sigaction"));
|
||||
#endif
|
||||
|
||||
bool gc_on_every_allocation = false;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio setkeymap getkeymap rpath wpath cpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio setkeymap getkeymap rpath wpath cpath"));
|
||||
TRY(Core::System::unveil("/res/keymaps", "r"));
|
||||
TRY(Core::System::unveil("/etc/Keyboard.ini", "rwc"));
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ static Core::ProcessStatistics const& get_proc(Core::AllProcessesStatistics cons
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio proc rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio proc rpath"));
|
||||
TRY(Core::System::unveil("/proc/all", "r"));
|
||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
TRY(Core::System::unveil("/sys/bus/usb", "r"));
|
||||
TRY(Core::System::unveil("/res/usb.ids", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
|
|
@ -54,7 +54,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (view_width == 0)
|
||||
view_width = 80;
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath exec proc", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath exec proc"));
|
||||
TRY(Core::System::unveil("/usr/share/man", "r"));
|
||||
TRY(Core::System::unveil("/bin", "x"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
@ -108,7 +108,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto file = TRY(Core::File::open(filename, Core::OpenMode::ReadOnly));
|
||||
|
||||
TRY(Core::System::pledge("stdio proc", nullptr));
|
||||
TRY(Core::System::pledge("stdio proc"));
|
||||
|
||||
dbgln("Loading man page from {}", file->filename());
|
||||
auto buffer = file->read_all();
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
auto file = TRY(Core::File::open("/proc/cpuinfo", Core::OpenMode::ReadOnly));
|
||||
|
||||
auto buffer = file->read_all();
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
TRY(Core::System::unveil("/proc", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath tty", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath tty"));
|
||||
String this_tty = ttyname(STDIN_FILENO);
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
TRY(Core::System::unveil("/proc/all", "r"));
|
||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
|
|
@ -20,7 +20,7 @@ enum TruncateOperation {
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath"));
|
||||
|
||||
const char* resize = nullptr;
|
||||
const char* reference = nullptr;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio wpath rpath cpath fattr proc exec", nullptr));
|
||||
TRY(Core::System::pledge("stdio wpath rpath cpath fattr proc exec"));
|
||||
TRY(Core::System::unveil("/etc/", "rwc"));
|
||||
TRY(Core::System::unveil("/bin/rm", "x"));
|
||||
|
||||
|
@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (remove_home) {
|
||||
TRY(Core::System::unveil(target_account.home_directory().characters(), "c"));
|
||||
} else {
|
||||
TRY(Core::System::pledge("stdio wpath rpath cpath fattr", nullptr));
|
||||
TRY(Core::System::pledge("stdio wpath rpath cpath fattr"));
|
||||
}
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
return 1;
|
||||
}
|
||||
|
||||
TRY(Core::System::pledge("stdio wpath rpath cpath fattr tty", nullptr));
|
||||
TRY(Core::System::pledge("stdio wpath rpath cpath fattr tty"));
|
||||
TRY(Core::System::unveil("/etc", "rwc"));
|
||||
|
||||
int uid = 0;
|
||||
|
@ -136,7 +136,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
target_account.set_gecos(gecos);
|
||||
}
|
||||
|
||||
TRY(Core::System::pledge("stdio wpath rpath cpath fattr", nullptr));
|
||||
TRY(Core::System::pledge("stdio wpath rpath cpath fattr"));
|
||||
if (!target_account.sync()) {
|
||||
perror("Core::Account::Sync");
|
||||
return 1;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio wpath cpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio wpath cpath"));
|
||||
TRY(Core::System::unveil("/var/run/utmp", "rwc"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
TRY(Core::System::unveil("/dev", "r"));
|
||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||
TRY(Core::System::unveil("/var/run/utmp", "r"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue