Closed Piccirello closed 3 years ago
Thanks for reporting this. Since this panic happens deep inside the godbus library it may have to be reported there if there is a way to replicate it outside of go-keyring
. As a first step we could try to update the library version and see if it has already been addressed.
Aha! That update seems to have fixed the panic:
Build:
thomas $ go get github.com/zalando/go-keyring@4d37811583adde6f2c303662712b318405f279ff
go: github.com/zalando/go-keyring 4d37811583adde6f2c303662712b318405f279ff => v0.1.1-0.20210112083600-4d37811583ad
go: downloading github.com/zalando/go-keyring v0.1.1-0.20210112083600-4d37811583ad
go: downloading github.com/godbus/dbus/v5 v5.0.3
thomas $ GOOS=linux go build -o keyring keyring-poc.go
Execution:
thomas@windows-server-2019:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
thomas@windows-server-2019:~$ /mnt/c/Users/thomas/Desktop/keyring
Error: dbus: couldn't determine address of session bus
Cool! Thanks for testing it!
Thanks for putting up a fix! Will there be a new release for these changes, or should I remain pinned to the specific commit?
@Piccirello We have made a new release now: https://github.com/zalando/go-keyring/releases/tag/v0.1.1
Calling
keyring.Set()
on Ubuntu 20.04 on WSL results in the following panic:panic: runtime error: slice bounds out of range
. On Ubuntu 18.04 on the same machine,keyring.Set()
fails more gracefully, returning the errorexec: "dbus-launch": executable file not found in $PATH
. I've included a minimal PoC to reproduce.OS: Microsoft Windows Server Version 1809
Ubuntu 20.04 on WSL:
Ubuntu 18.04 on WSL: