diff --git a/Cargo.toml b/Cargo.toml index 1d59688..48f7416 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "anime-launcher-sdk" -version = "1.1.5" +version = "1.1.6" authors = ["Nikita Podvirnyy "] license = "GPL-3.0" readme = "README.md" diff --git a/src/config/schema_blanks/sandbox/mod.rs b/src/config/schema_blanks/sandbox/mod.rs index 0990d17..a6b3590 100644 --- a/src/config/schema_blanks/sandbox/mod.rs +++ b/src/config/schema_blanks/sandbox/mod.rs @@ -117,10 +117,12 @@ impl Sandbox { /// | Original | Mounted | Type | Optional | /// | :- | :- | :- | :- | /// | `/` | `/` | read-only bind | false | + /// | `/tmp` | `/tmp` | bind | false | + /// | `/proc` | `/proc` | bind | false | + /// | `/dev` | `/dev` | dev bind | false | /// | - | `/home` | tmpfs | true | /// | - | `/var/home/$USER` | tmpfs | true | /// | - | `$HOME` | tmpfs | true | - /// | - | `/tmp` | tmpfs | false | /// | `wine_dir` | `/tmp/sandbox/wine` | bind | false | /// | `prefix_dir` | `/tmp/sandbox/prefix` | bind | false | /// | `game_dir` | `/tmp/sandbox/game` | bind | false | @@ -130,6 +132,10 @@ impl Sandbox { pub fn get_command(&self, wine_dir: impl AsRef, prefix_dir: impl AsRef, game_dir: impl AsRef) -> String { let mut command = String::from("bwrap --ro-bind / /"); + command.push_str(" --bind /tmp /tmp"); + command.push_str(" --bind /proc /proc"); + command.push_str(" --dev-bind /dev /dev"); + if let Some(hostname) = &self.hostname { command += &format!(" --hostname '{hostname}'"); } @@ -151,8 +157,6 @@ impl Sandbox { command += &format!(" --tmpfs '{}'", path.trim()); } - command.push_str(" --tmpfs /tmp"); - for (from, to) in &self.mounts.read_only { command += &format!(" --ro-bind '{}' '{}'", from.trim(), to.trim()); } @@ -171,8 +175,12 @@ impl Sandbox { command.push_str(" --die-with-parent"); - command.push_str(" --unshare-all"); - command.push_str(" --share-net"); + // --unshare-pid breaks wine + + command.push_str(" --unshare-user"); + command.push_str(" --unshare-ipc"); + command.push_str(" --unshare-uts"); + command.push_str(" --unshare-cgroup"); if let Some(args) = &self.args { command.push_str(args.trim());