context/unshare: mount proc and dev/pts

This commit is contained in:
2026-01-09 23:08:59 +01:00
parent 464e25de24
commit dd62baa455
2 changed files with 10 additions and 2 deletions

View File

@@ -172,9 +172,12 @@ impl UnshareDriver {
cmd.arg("--map-user=65536")
.arg("--map-group=65536")
.arg("--mount-proc")
.arg("--pid")
.arg("--ipc")
.arg("--uts")
.arg("--user")
.arg("--cgroup")
.arg("--map-auto")
.arg("-r")
.arg("--mount")
@@ -186,7 +189,11 @@ impl UnshareDriver {
cmd.arg("-w").arg(dir);
}
cmd.arg("--").arg(program).args(args);
cmd.arg("--").arg("bash").arg("-c").arg(format!(
"mount -t devpts devpts /dev/pts; mount --bind /dev/pts/ptmx /dev/ptmx; {} {}",
program,
args.join(" ")
));
cmd
}