aboutsummaryrefslogtreecommitdiffhomepage
path: root/dbus/proxy.go
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/proxy.go')
-rw-r--r--dbus/proxy.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/dbus/proxy.go b/dbus/proxy.go
index a18bf753..c44971eb 100644
--- a/dbus/proxy.go
+++ b/dbus/proxy.go
@@ -2,6 +2,7 @@ package dbus
import (
"context"
+ "fmt"
"io"
"os/exec"
"sync"
@@ -14,6 +15,15 @@ import (
// Overriding ProxyName will only affect Proxy instance created after the change.
var ProxyName = "xdg-dbus-proxy"
+type BadInterfaceError struct {
+ Interface string
+ Segment string
+}
+
+func (e *BadInterfaceError) Error() string {
+ return fmt.Sprintf("bad interface string %q in %s bus configuration", e.Interface, e.Segment)
+}
+
// Proxy holds the state of a xdg-dbus-proxy process, and should never be copied.
type Proxy struct {
helper helper.Helper
@@ -66,9 +76,15 @@ func Finalise(sessionBus, systemBus ProxyPair, session, system *Config) (final *
var args []string
if session != nil {
+ if err = session.checkInterfaces("session"); err != nil {
+ return
+ }
args = append(args, session.Args(sessionBus)...)
}
if system != nil {
+ if err = system.checkInterfaces("system"); err != nil {
+ return
+ }
args = append(args, system.Args(systemBus)...)
}