keybase / go-keychain

Golang keychain package for iOS and macOS
MIT License
574 stars 118 forks source link

Use upstream dbus library to fix "authentication failed" errors #83

Closed heyLu closed 2 years ago

heyLu commented 2 years ago

The forked one at https://github.com/keybase/go.dbus has issues that make it incompatible with current systems, causing "authentication failed" errors. This is likely caused by using the user name instead of the user id in the auth.go in the custom dbus package, which https://github.com/godbus/dbus fixes, likely among other fixes.

With the switch the connection to DBus works again on several Linux-based systems with various DBus versions running.

To see the exact error, you can run https://github.com/keybase/go.dbus/blob/master/_examples/list-names.go which does not work anymore on modern Linux systems.

$ GO111MODULE=off go run _examples/list-names.go
Failed to connect to session bus: dbus: authentication failed
exit status 1

(GO111MODULE is necessary because go.dbus does not have a go.mod file.)

In contrast, https://github.com/godbus/dbus/blob/master/_examples/list-names.go works:

$ go run _examples/list-names.go
Currently owned names on the session bus:
org.freedesktop.DBus
:1.7
org.freedesktop.Notifications
org.keepassxc.KeePassXC.MainWindow
:1.8
org.papill0n.Healthy
<more output here>
heronhaye commented 2 years ago

Thank you for your PR. We've updated to godbus in a separate PR.