diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-10 02:23:34 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-10 02:23:34 +0900 |
| commit | 22ee5ae151fa991cf23dbf1b3efb5a0d6fb9b092 (patch) | |
| tree | f0bac6b7a1d52af021f9e48c9d04cb371f291a0e /internal/app/spdbus.go | |
| parent | 4246256d781f169b86f76d8654f6df5ffc6ddae6 (diff) | |
internal/app: filter ops in implementation
This is cleaner and less error-prone, and should also result in negligibly less memory allocation.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/spdbus.go')
| -rw-r--r-- | internal/app/spdbus.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/app/spdbus.go b/internal/app/spdbus.go index 0d26d997..ac27eeb0 100644 --- a/internal/app/spdbus.go +++ b/internal/app/spdbus.go @@ -4,6 +4,7 @@ import ( "encoding/gob" "hakurei.app/container/fhs" + "hakurei.app/hst" "hakurei.app/system/acl" "hakurei.app/system/dbus" ) @@ -18,6 +19,10 @@ type spDBusOp struct { } func (s *spDBusOp) toSystem(state *outcomeStateSys) error { + if state.config.Enablements.Unwrap()&hst.EDBus == 0 { + return errNotEnabled + } + if state.config.SessionBus == nil { state.config.SessionBus = dbus.NewConfig(state.config.ID, true, true) } |
