Files
AnyPS5/docs/dev/debt/changes/fix-libkernel-socketpair-local-options.md

1014 B

libkernel

add Functional

  • LOCAL_PEERCRED, LOCAL_CREDS and LOCAL_CONNWAIT (libkernel) - throw on an AF_UNIX socket received through SCM_RIGHTS or adopted from the host, whose peer credentials are not known, and setting LOCAL_CREDS throws on every AF_UNIX socket, as recvmsg adds no SCM_CREDS message. On a socketpair socket they follow FreeBSD 11.4's kern_socketpair and uipc_ctloutput: a stream or sequenced-packet pair reports the xucred of the identity it was made with (geteuid and the first 16 groups of getgroups), a datagram pair fails with EINVAL, LOCAL_CREDS reads 0, and LOCAL_CONNWAIT reads what was last set on that socket. That flag only delays a connect to a listener, which an AF_UNIX socket cannot make here