oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package runner
2
3import "golang.org/x/sys/unix"
4
5const walkFlags = unix.O_PATH
6
7func peerUID(fd int) (uint32, error) {
8 cred, err := unix.GetsockoptUcred(fd, unix.SOL_SOCKET, unix.SO_PEERCRED)
9 if err != nil {
10 return 0, err
11 }
12 return cred.Uid, nil
13}
14