From 44277dc0f1fd1806f5ceea34246a4c805a06b61b Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 17 Mar 2025 00:13:14 +0900 Subject: dbus: run in native sandbox Signed-off-by: Ophestra --- helper/stub.go | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'helper') diff --git a/helper/stub.go b/helper/stub.go index 942f1501..21ab5f45 100644 --- a/helper/stub.go +++ b/helper/stub.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "os" - "path" "strconv" "strings" "syscall" @@ -137,27 +136,7 @@ func bwrapStub() { AsInit: true, } - efp := new(proc.ExtraFilesPre) - if t, ok := os.LookupEnv("GO_TEST_FORTIFY_BWRAP_STUB_TYPE"); ok { - switch t { - case "dbus": - sc.Net = false - sc.Hostname = "fortify-dbus" - sc.Chdir = "/" - sc.Syscall = &bwrap.SyscallPolicy{DenyDevel: true, Multiarch: true} - sc.AsInit = false - sc. - Bind("/run/user/1971", "/run/user/1971"). - Bind("/tmp/fortify.1971/12622d846cc3fe7b4c10359d01f0eb47", "/tmp/fortify.1971/12622d846cc3fe7b4c10359d01f0eb47", false, true). - Bind(path.Dir(os.Args[0]), path.Dir(os.Args[0])) - - // manipulate extra files list so fd ends up as 5 - efp.Append() - efp.Append() - } - } - - if _, err := MustNewCheckedArgs(sc.Args(nil, efp, new([]proc.File))). + if _, err := MustNewCheckedArgs(sc.Args(nil, new(proc.ExtraFilesPre), new([]proc.File))). WriteTo(want); err != nil { panic("cannot read want: " + err.Error()) } -- cgit v1.3.1