diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-10 03:19:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-10 03:19:09 +0900 |
| commit | 109aaee6593ac6e72d23b817e5b75292c2ed7bed (patch) | |
| tree | 459fbd8f8c0685b33002fb1f9c101c9b39a38b6a /internal/app/spdbus.go | |
| parent | 22ee5ae151fa991cf23dbf1b3efb5a0d6fb9b092 (diff) | |
internal/app: copy parts of config to state
This is less error-prone than passing the address to the entire hst.Config struct, and reduces the likelihood of accidentally clobbering hst.Config. This also improves ease of testing.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/spdbus.go')
| -rw-r--r-- | internal/app/spdbus.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/app/spdbus.go b/internal/app/spdbus.go index ac27eeb0..604450a0 100644 --- a/internal/app/spdbus.go +++ b/internal/app/spdbus.go @@ -19,26 +19,26 @@ type spDBusOp struct { } func (s *spDBusOp) toSystem(state *outcomeStateSys) error { - if state.config.Enablements.Unwrap()&hst.EDBus == 0 { + if state.et&hst.EDBus == 0 { return errNotEnabled } - if state.config.SessionBus == nil { - state.config.SessionBus = dbus.NewConfig(state.config.ID, true, true) + if state.sessionBus == nil { + state.sessionBus = dbus.NewConfig(state.appId, true, true) } // downstream socket paths sessionPath, systemPath := state.instance().Append("bus"), state.instance().Append("system_bus_socket") if err := state.sys.ProxyDBus( - state.config.SessionBus, state.config.SystemBus, + state.sessionBus, state.systemBus, sessionPath, systemPath, ); err != nil { return err } state.sys.UpdatePerm(sessionPath, acl.Read, acl.Write) - if state.config.SystemBus != nil { + if state.systemBus != nil { s.ProxySystem = true state.sys.UpdatePerm(systemPath, acl.Read, acl.Write) } |
