From 33cf0bed540a9b2c439bdca4869af8faf9f52cf4 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Wed, 16 Oct 2024 01:27:49 +0900 Subject: [PATCH] dbus: various accessors for dbus.Proxy internal fields These values are useful during sandbox setup and exporting them makes more sense than storing them twice. Signed-off-by: Ophestra Umiker --- dbus/proxy.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dbus/proxy.go b/dbus/proxy.go index 7e7d9a6..f3474a8 100644 --- a/dbus/proxy.go +++ b/dbus/proxy.go @@ -28,6 +28,21 @@ type Proxy struct { lock sync.RWMutex } +func (p *Proxy) Session() [2]string { + return p.session +} + +func (p *Proxy) System() [2]string { + return p.system +} + +func (p *Proxy) Sealed() bool { + p.lock.RLock() + defer p.lock.RUnlock() + + return p.seal != nil +} + var ( ErrConfig = errors.New("no configuration to seal") )