diff options
Diffstat (limited to 'internal/app')
| -rw-r--r-- | internal/app/app_nixos_test.go | 4 | ||||
| -rw-r--r-- | internal/app/app_pd_test.go | 4 | ||||
| -rw-r--r-- | internal/app/share.go | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/internal/app/app_nixos_test.go b/internal/app/app_nixos_test.go index 18a42e16..8923e9be 100644 --- a/internal/app/app_nixos_test.go +++ b/internal/app/app_nixos_test.go @@ -64,7 +64,7 @@ var testCasesNixos = []sealTestCase{ Ephemeral(system.Process, "/run/user/1971/fortify/8e2c76b066dabe574cf073bdb46eb5c1", 0700).UpdatePermType(system.Process, "/run/user/1971/fortify/8e2c76b066dabe574cf073bdb46eb5c1", acl.Execute). UpdatePermType(system.EWayland, "/run/user/1971/wayland-0", acl.Read, acl.Write, acl.Execute). Link("/run/user/1971/pulse/native", "/run/user/1971/fortify/8e2c76b066dabe574cf073bdb46eb5c1/pulse"). - CopyFile("/tmp/fortify.1971/8e2c76b066dabe574cf073bdb46eb5c1/pulse-cookie", "/home/ophestra/xdg/config/pulse/cookie"). + CopyFile(nil, "/home/ophestra/xdg/config/pulse/cookie", 256, 256). MustProxyDBus("/tmp/fortify.1971/8e2c76b066dabe574cf073bdb46eb5c1/bus", &dbus.Config{ Talk: []string{ "org.freedesktop.FileManager1", "org.freedesktop.Notifications", @@ -213,7 +213,7 @@ var testCasesNixos = []sealTestCase{ CopyBind("/etc/group", []byte("fortify:x:1971:\n")). Bind("/run/user/1971/wayland-0", "/run/user/1971/wayland-0"). Bind("/run/user/1971/fortify/8e2c76b066dabe574cf073bdb46eb5c1/pulse", "/run/user/1971/pulse/native"). - Bind("/tmp/fortify.1971/8e2c76b066dabe574cf073bdb46eb5c1/pulse-cookie", fst.Tmp+"/pulse-cookie"). + CopyBind(fst.Tmp+"/pulse-cookie", nil). Bind("/tmp/fortify.1971/8e2c76b066dabe574cf073bdb46eb5c1/bus", "/run/user/1971/bus"). Bind("/tmp/fortify.1971/8e2c76b066dabe574cf073bdb46eb5c1/system_bus_socket", "/run/dbus/system_bus_socket"). Tmpfs("/var/run/nscd", 8192). diff --git a/internal/app/app_pd_test.go b/internal/app/app_pd_test.go index 269c8aa3..4d90d7fc 100644 --- a/internal/app/app_pd_test.go +++ b/internal/app/app_pd_test.go @@ -219,7 +219,7 @@ var testCasesPd = []sealTestCase{ Ensure("/tmp/fortify.1971/wayland", 0711). Wayland("/tmp/fortify.1971/wayland/ebf083d1b175911782d413369b64ce7c", "/run/user/1971/wayland-0", "org.chromium.Chromium", "ebf083d1b175911782d413369b64ce7c"). Link("/run/user/1971/pulse/native", "/run/user/1971/fortify/ebf083d1b175911782d413369b64ce7c/pulse"). - CopyFile("/tmp/fortify.1971/ebf083d1b175911782d413369b64ce7c/pulse-cookie", "/home/ophestra/xdg/config/pulse/cookie"). + CopyFile(new([]byte), "/home/ophestra/xdg/config/pulse/cookie", 256, 256). MustProxyDBus("/tmp/fortify.1971/ebf083d1b175911782d413369b64ce7c/bus", &dbus.Config{ Talk: []string{ "org.freedesktop.Notifications", @@ -382,7 +382,7 @@ var testCasesPd = []sealTestCase{ CopyBind("/etc/group", []byte("fortify:x:65534:\n")). Bind("/tmp/fortify.1971/wayland/ebf083d1b175911782d413369b64ce7c", "/run/user/65534/wayland-0"). Bind("/run/user/1971/fortify/ebf083d1b175911782d413369b64ce7c/pulse", "/run/user/65534/pulse/native"). - Bind("/tmp/fortify.1971/ebf083d1b175911782d413369b64ce7c/pulse-cookie", fst.Tmp+"/pulse-cookie"). + CopyBind(fst.Tmp+"/pulse-cookie", nil). Bind("/tmp/fortify.1971/ebf083d1b175911782d413369b64ce7c/bus", "/run/user/65534/bus"). Bind("/tmp/fortify.1971/ebf083d1b175911782d413369b64ce7c/system_bus_socket", "/run/dbus/system_bus_socket"). Tmpfs("/var/run/nscd", 8192). diff --git a/internal/app/share.go b/internal/app/share.go index c7f0c7a3..1862fb2b 100644 --- a/internal/app/share.go +++ b/internal/app/share.go @@ -231,11 +231,11 @@ func (seal *appSeal) setupShares(bus [2]*dbus.Config, os linux.System) error { // not fatal fmsg.Verbose(strings.TrimSpace(err.(*fmsg.BaseError).Message())) } else { - dst := path.Join(seal.share, "pulse-cookie") innerDst := fst.Tmp + "/pulse-cookie" seal.sys.bwrap.SetEnv[pulseCookie] = innerDst - seal.sys.CopyFile(dst, src) - seal.sys.bwrap.Bind(dst, innerDst) + payload := new([]byte) + seal.sys.bwrap.CopyBindRef(innerDst, &payload) + seal.sys.CopyFile(payload, src, 256, 256) } } |
