mirror of
https://github.com/rwinkhart/peercred-mini.git
synced 2026-08-27 20:36:30 -04:00
Initial FreeBSD PID support
This commit is contained in:
@@ -2,4 +2,4 @@ module github.com/rwinkhart/peercred-mini
|
||||
|
||||
go 1.24.1
|
||||
|
||||
require golang.org/x/sys v0.31.0
|
||||
require github.com/rwinkhart/sys v0.0.0-20250404053244-7215932ae926
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
golang.org/x/sys v0.29.1-0.20250107080300-1c14dcadc3ab h1:BMkEEWYOjkvOX7+YKOGbp6jCyQ5pR2j0Ah47p1Vdsx4=
|
||||
golang.org/x/sys v0.29.1-0.20250107080300-1c14dcadc3ab/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
github.com/rwinkhart/sys v0.0.0-20250404053244-7215932ae926 h1:MJe9Z46ilI9g7N3/JvQ4pHdXlZvb7InTb3aCoXrSRXM=
|
||||
github.com/rwinkhart/sys v0.0.0-20250404053244-7215932ae926/go.mod h1:vs22XiZlTvulYNkiIbKpx01rWq8dXeSF3PML0S2nQd4=
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import (
|
||||
"net"
|
||||
"strconv"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
"github.com/rwinkhart/sys/unix"
|
||||
)
|
||||
|
||||
func getUnix(c *net.UnixConn) (*Creds, error) {
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import (
|
||||
"net"
|
||||
"strconv"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
"github.com/rwinkhart/sys/unix"
|
||||
)
|
||||
|
||||
func getUnix(c *net.UnixConn) (*Creds, error) {
|
||||
@@ -35,7 +35,7 @@ func getUnix(c *net.UnixConn) (*Creds, error) {
|
||||
return nil, err
|
||||
}
|
||||
return &Creds{
|
||||
pid: 0, // FreeBSD 13 adds a cr_pid field, can be used here.
|
||||
pid: int(cred.Pid),
|
||||
uid: strconv.FormatUint(uint64(cred.Uid), 10),
|
||||
}, nil
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import (
|
||||
"net"
|
||||
"strconv"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
"github.com/rwinkhart/sys/unix"
|
||||
)
|
||||
|
||||
func getUnix(c *net.UnixConn) (*Creds, error) {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import (
|
||||
"net"
|
||||
"strconv"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
"github.com/rwinkhart/sys/unix"
|
||||
)
|
||||
|
||||
func getUnix(c *net.UnixConn) (*Creds, error) {
|
||||
|
||||
Reference in New Issue
Block a user