mirror of
https://github.com/rwinkhart/peercred-mini.git
synced 2026-09-01 22:57:28 -04:00
Strip unneeded functionality
This commit is contained in:
@@ -12,20 +12,6 @@ import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func init() {
|
||||
osGet = getLinux
|
||||
}
|
||||
|
||||
func getLinux(c net.Conn) (*Creds, error) {
|
||||
switch c := c.(type) {
|
||||
case *net.UnixConn:
|
||||
return getUnix(c)
|
||||
case *net.TCPConn:
|
||||
// TODO: use /proc tcp info for localhost connections like Windows?
|
||||
}
|
||||
return nil, ErrUnsupportedConnType
|
||||
}
|
||||
|
||||
func getUnix(c *net.UnixConn) (*Creds, error) {
|
||||
raw, err := c.SyscallConn()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user