agent: Fix get_client_pid for portability.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 7 Mar 2017 05:01:17 +0000 (14:01 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 7 Mar 2017 05:06:35 +0000 (14:06 +0900)
commitf7f806afa5083617f4aba02fc3b285b06a7d73d4
treeb06550000e9af382e6fbdecfdd2455ae4fe6fc73
parentb9ab733fc0dd2ca2a7eaac0bde3a817c07af36c5
agent: Fix get_client_pid for portability.

* configure.ac: Simply check getpeerucred and ucred.h, and structure
members.
* agent/command-ssh.c: Include ucred.h.
(get_client_pid) [HAVE_STRUCT_SOCKPEERCRED_PID]: Use sockpeercred
structure for OpenBSD.
[LOCAL_PEERPID]: Use LOCAL_PEERPID for macOS.
[LOCAL_PEEREID]: Use LOCAL_PEEREID for NetBSD.
[HAVE_GETPEERUCRED]: Use getpeerucred for OpenSolaris.

--

This change also addresses following bug.

GnuPG-bug-id: 2981.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
agent/command-ssh.c
configure.ac