Bump peercred-mini

This commit is contained in:
2025-04-05 15:28:52 -04:00
parent 107f4bcf02
commit 94868f6bad
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -83,15 +83,15 @@ func handleConn(conn net.Conn) {
ucred := peercred.Get(conn)
// check if the RPC call is coming from an identical binary and from the same user
callingBinPath := pidToPath(ucred.PID())
if ucred.UserID() == strconv.Itoa(os.Getuid()) && bytes.Equal(getFileHash(callingBinPath), daemonHash) {
callingBinPath := pidToPath(ucred.PID)
if ucred.UID == strconv.Itoa(os.Getuid()) && bytes.Equal(getFileHash(callingBinPath), daemonHash) {
// valid client; hand off the connection to the RPC server
rpc.ServeConn(conn)
} else {
// invalid client; close the connection w/o a response,
// log the client's path, and kill the daemon
conn.Close()
log.Printf("Request received from invalid client: PID(%d), UID(%s), Path(%s)", ucred.PID(), ucred.UserID(), callingBinPath) // TODO log to file
log.Printf("Request received from invalid client: PID(%d), UID(%s), Path(%s)", ucred.PID, ucred.UID, callingBinPath) // TODO log to file
os.Exit(2)
}
}
+1 -1
View File
@@ -2,6 +2,6 @@ module rcw
go 1.24.2
require github.com/rwinkhart/peercred-mini v0.0.0-20250405012931-0e071fcd683d
require github.com/rwinkhart/peercred-mini v0.0.0-20250405191724-d116525c2b41
require github.com/rwinkhart/sys-freebsd-13-xucred v0.0.0-20250405011819-d304d362d032 // indirect
+2 -2
View File
@@ -1,4 +1,4 @@
github.com/rwinkhart/peercred-mini v0.0.0-20250405012931-0e071fcd683d h1:Uio9uhJuKLp8+c/C3TUrsC9Vd93hBK5oRcm2+o8+DvI=
github.com/rwinkhart/peercred-mini v0.0.0-20250405012931-0e071fcd683d/go.mod h1:cH3916WNofkve4MeeK56H0whuUUVf57iYht3nsUyEh8=
github.com/rwinkhart/peercred-mini v0.0.0-20250405191724-d116525c2b41 h1:wUMbTEwPIf6bqLCAUmJ58uuYu6OX0iGa6S6NjYUXGPA=
github.com/rwinkhart/peercred-mini v0.0.0-20250405191724-d116525c2b41/go.mod h1:cH3916WNofkve4MeeK56H0whuUUVf57iYht3nsUyEh8=
github.com/rwinkhart/sys-freebsd-13-xucred v0.0.0-20250405011819-d304d362d032 h1:4qzc09ysQhkyI2oN7pLbZMQP+qHq2TlVRCkMSmbl8m8=
github.com/rwinkhart/sys-freebsd-13-xucred v0.0.0-20250405011819-d304d362d032/go.mod h1:U89aT1yaUAbs+9Dp9i1lZ2+5GsRNYk0l42+d1wykDBA=