-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
Go doesn't have an interface to get the peer security context of a Unix socket. This is basically the same issue as #3836 but for SO_PEERSEC. SO_PEERSEC retrieves the peer's SELinux or AppArmor label. The return value a NULL-terminated string with maximum 255 chars. SO_PEERSEC is a Linux-only option for getsockopt.
Python example:
>>> import socket
>>> a, b = socket.socketpair()
>>> a.getsockopt(socket.SOL_SOCKET, socket.SO_PEERSEC, 255)
'system_u:object_r:unlabeled_t:s0\x00'
Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (
go version)?
go version go1.6.2 linux/amd64 - What operating system and processor architecture are you using (
go env)?
Fedora 24 X86_64
Reactions are currently unavailable