hashicorp / hashicorp/go-plugin
permission denied on sharing unix domain sockets with different user
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 511
- Avg merge
- 22h 47m
- Merged PRs (30d)
- 4
Description
Mother host process running as user A. Plugin process running with sudo i.e root.
Plugin creates a unix domain socket at /tmp/plugin226668393 but mother host is unable to connect.
`rpc error: code = Unavailable desc = connection error: desc = "transport: error while dialing: dial unix /tmp/plugin226668393: connect: permission denied"
`
**Possible solutions:**
### Shared directory
- Provide options to create socket in a common shareable location (/var/go-plugin). Something like under /var/go-plugin/pluginxxxxxxx
Reference: https://github.com/hashicorp/go-plugin/blob/master/server.go#L547-L574
Tutorial: https://medium.com/@aeronanubhav/sharing-unix-domain-sockets-with-multiple-users-4c7b4d439c39
### Use tcp instead in linux
- Provide options to use tcp instead of unix domain socket in linux. https://github.com/hashicorp/go-plugin/blob/master/server.go#L497-L503
Contributor guide
Assessment
This issue has not been assessed yet.