fix: network namespace detection false negative (#12)

Co-authored-by: netixen <netixen@spaceship>
This commit is contained in:
priuatus
2026-01-20 21:30:18 +02:00
committed by GitHub
parent 89301f8c8a
commit 06c2cc9a34

View File

@@ -200,7 +200,8 @@ func (f *LinuxFeatures) detectNetworkNamespace() {
// Run a minimal bwrap command with --unshare-net to test if it works
// We use a very short timeout since this should either succeed or fail immediately
cmd := exec.Command("bwrap", "--unshare-net", "--", "/bin/true")
// The bind mount is required in some environments
cmd := exec.Command("bwrap", "--unshare-net", "--ro-bind", "/", "/", "--", "/bin/true")
err := cmd.Run()
f.CanUnshareNet = err == nil
}