github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/lang/ipc/cred.go (about)

     1  //go:build ignore
     2  // +build ignore
     3  
     4  // Package peercred is an easy to use wrapper around the Linux
     5  // SO_PEERCRED socket option on Unix domain sockets.  It degrades
     6  // gracefully with an unsupported error on other operating systems.
     7  package ipc
     8  
     9  // Cred is the structure containing peer credentials.  Linux passes the
    10  // process ID (pid), user ID (uid), and group ID (gid) from the other
    11  // side of the connection.
    12  //
    13  // This structure mimics the ucred structure from the <linux/socket.h>
    14  // file.
    15  //
    16  // These values are populated at socket creation time, and will not
    17  // reflect privileges dropped after the creation of the socket.
    18  type Cred struct {
    19  	PID int32
    20  	UID uint32
    21  	GID uint32
    22  }