From 2faf510146733c28a5dbc3245175700abcf4f966 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Tue, 15 Oct 2024 02:15:55 +0900 Subject: helper/bwrap: ordered filesystem args The argument builder was written based on the incorrect assumption that bwrap arguments are unordered. The argument builder is replaced in this commit to correct that mistake. Signed-off-by: Ophestra Umiker --- dbus/run.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'dbus') diff --git a/dbus/run.go b/dbus/run.go index 2aad777a..a9b31e50 100644 --- a/dbus/run.go +++ b/dbus/run.go @@ -79,11 +79,9 @@ func (p *Proxy) Start(ready chan error, output io.Writer, sandbox bool) error { } } } - bindTargetDedup := make([][2]string, 0, len(bindTarget)) for k := range bindTarget { - bindTargetDedup = append(bindTargetDedup, [2]string{k, k}) + bc.Bind(k, k, false, true) } - bc.Bind = append(bc.Bind, bindTargetDedup...) roBindTarget := make(map[string]struct{}, 2+1+len(proxyDeps)) @@ -103,11 +101,9 @@ func (p *Proxy) Start(ready chan error, output io.Writer, sandbox bool) error { } } - roBindTargetDedup := make([][2]string, 0, len(roBindTarget)) for k := range roBindTarget { - roBindTargetDedup = append(roBindTargetDedup, [2]string{k, k}) + bc.Bind(k, k) } - bc.ROBind = append(bc.ROBind, roBindTargetDedup...) h = helper.MustNewBwrap(bc, p.seal, toolPath, argF) cmd = h.Unwrap() -- cgit v1.3.1