Panic when unable to add-peer due to permissions #32

Closed
opened 2025-11-20 05:05:11 -05:00 by saavagebueno · 1 comment
Owner

Originally created by @kingforaday on GitHub (Jul 16, 2021).

Originally assigned to: @mlsmaycon on GitHub.

As an un elevated user:

~/wiretrustee ❯ wiretrustee add-peer --allowedIPs 10.30.30.2/32 --key MY3paM+bln5PEoNahHMjzTUg3embjlsVOEIhPqyFC1o=
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x15d5def]

goroutine 1 [running]:
github.com/wiretrustee/wiretrustee/cmd.glob..func1(0x1ba3fe0, 0xc0000bff40, 0x0, 0x4)
	/home/runner/work/wiretrustee/wiretrustee/cmd/addpeer.go:26 +0xcf
github.com/spf13/cobra.(*Command).execute(0x1ba3fe0, 0xc0000bfec0, 0x4, 0x4, 0x1ba3fe0, 0xc0000bfec0)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x1ba49e0, 0x0, 0x162fc20, 0xc00008c058)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
github.com/wiretrustee/wiretrustee/cmd.Execute(...)
	/home/runner/work/wiretrustee/wiretrustee/cmd/root.go:31
main.main()
	/home/runner/work/wiretrustee/wiretrustee/main.go:9 +0x2e

When performing the same action with sudo:

~/wiretrustee 15s ❯ sudo wiretrustee add-peer --allowedIPs 10.30.30.2/32 --key MY3paM+bln5PEoNahHMjzTUg3embjlsVOEIhPqyFC1o=
~/wiretrustee ❯
Originally created by @kingforaday on GitHub (Jul 16, 2021). Originally assigned to: @mlsmaycon on GitHub. As an un elevated user: ```bash ~/wiretrustee ❯ wiretrustee add-peer --allowedIPs 10.30.30.2/32 --key MY3paM+bln5PEoNahHMjzTUg3embjlsVOEIhPqyFC1o= panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x15d5def] goroutine 1 [running]: github.com/wiretrustee/wiretrustee/cmd.glob..func1(0x1ba3fe0, 0xc0000bff40, 0x0, 0x4) /home/runner/work/wiretrustee/wiretrustee/cmd/addpeer.go:26 +0xcf github.com/spf13/cobra.(*Command).execute(0x1ba3fe0, 0xc0000bfec0, 0x4, 0x4, 0x1ba3fe0, 0xc0000bfec0) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2 github.com/spf13/cobra.(*Command).ExecuteC(0x1ba49e0, 0x0, 0x162fc20, 0xc00008c058) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375 github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897 github.com/wiretrustee/wiretrustee/cmd.Execute(...) /home/runner/work/wiretrustee/wiretrustee/cmd/root.go:31 main.main() /home/runner/work/wiretrustee/wiretrustee/main.go:9 +0x2e ``` When performing the same action with `sudo`: ```bash ~/wiretrustee 15s ❯ sudo wiretrustee add-peer --allowedIPs 10.30.30.2/32 --key MY3paM+bln5PEoNahHMjzTUg3embjlsVOEIhPqyFC1o= ~/wiretrustee ❯ ```
Author
Owner

@mlsmaycon commented on GitHub (Jul 17, 2021):

@kingforaday fixes have been implemented and will be available in the next release.

We were missing a check on the read function error response, then the software continued causing the panic status.

Thanks for reporting it.

@mlsmaycon commented on GitHub (Jul 17, 2021): @kingforaday fixes have been implemented and will be available in the next release. We were missing a check on the read function error response, then the software continued causing the panic status. Thanks for reporting it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#32