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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 16 Jul 2021 17:36:29 +0000 (13:36 -0400)
commit4dc766fa8a92a9862c3f9d560751a941b4599380
tree39ecd71fdb61091b98124795097c74f7c9682021
parent8ec89801730aef6c4af48c45938380e7dec71d59
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.025855 seconds and 4 git commands to generate.