1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:47:35 +00:00

Kernel: Allow configuring a Jail to not impose PID isolation restriction

This is quite useful for userspace applications that can't cope with the
restriction, but it's still useful to impose other non-configurable
restrictions by using jails.
This commit is contained in:
Liav A 2023-01-12 22:47:09 +02:00 committed by Jelle Raaijmakers
parent cf8875426d
commit 8289759f1d
11 changed files with 62 additions and 23 deletions

View file

@ -31,7 +31,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (existing_jail_index.has_value()) {
TRY(Core::System::join_jail(existing_jail_index.value()));
} else {
u64 new_jail_index = TRY(Core::System::create_jail(new_jail_name.is_null() ? ""sv : new_jail_name));
// NOTE: We create a jail with "default" isolation options (as we define them in this program)
JailIsolationFlags default_flags = (JailIsolationFlags::PIDIsolation);
u64 new_jail_index = TRY(Core::System::create_jail(new_jail_name.is_null() ? ""sv : new_jail_name, default_flags));
TRY(Core::System::join_jail(new_jail_index));
}
TRY(Core::System::exec_command(command, preserve_env));