system/dbus: remove builder state leak

This enables external testing of system.I state.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-10-14 01:33:44 +09:00
parent e5ff40e7d3
commit 790d77075e
9 changed files with 102 additions and 65 deletions

View File

@@ -13,6 +13,7 @@ import (
"hakurei.app/container/check"
"hakurei.app/internal"
"hakurei.app/message"
"hakurei.app/system/dbus"
)
// osFile represents [os.File].
@@ -63,6 +64,9 @@ type syscallDispatcher interface {
// mustHsuPath provides [internal.MustHsuPath].
mustHsuPath() *check.Absolute
// dbusAddress provides [dbus.Address].
dbusAddress() (session, system string)
// fatalf provides [log.Fatalf].
fatalf(format string, v ...any)
}
@@ -99,4 +103,6 @@ func (direct) overflowGid(msg message.Msg) int { return container.OverflowGid(ms
func (direct) mustHsuPath() *check.Absolute { return internal.MustHsuPath() }
func (k direct) dbusAddress() (session, system string) { return dbus.Address() }
func (direct) fatalf(format string, v ...any) { log.Fatalf(format, v...) }