Build fix: retrieve unix socket peer PID on non-unix platforms
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Jul 2021 19:19:15 +0000 (15:19 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Thu, 15 Jul 2021 15:42:22 +0000 (11:42 -0400)
commit9bc1a4b4f0dc0dab6be2ea56d0cbdf4d703865f5
tree7a767e114f5e2eca24534449ef60aaa830bdf96a
parent97cf926dbf759c1590424cb58b2e5fdb970ae468
Build fix: retrieve unix socket peer PID on non-unix platforms

The previous attempt at extending the credential retrieval wrapper was
broken and didn't build on FreeBSD, macOS, and cygwin.

A platform-specific way of retrieving the PID of a unix peer is
implemented for FreeBSD (getsockopt using LOCAL_PEERCRED, note that the
cr_pid field is only available from FreeBSD 13 and up),
macOS (getsockopt using LOCAL_PEERPID, macOS 10.8+), and
Solaris (getpeerucreds).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ifcf522c70ee4c2e0799293ae0961f41aebff5056
src/common/compat/socket.h
src/common/unix.c
This page took 0.026343 seconds and 4 git commands to generate.