diff options
author | Werner Koch <[email protected]> | 2017-02-03 16:13:08 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-02-03 16:13:08 +0000 |
commit | 309f464a5952c7d7504b875bf4853914b1242346 (patch) | |
tree | 7c81ec6fbd9c8f02bfcbef9dbcdd3f9323654b92 /configure.ac | |
parent | gpg: More diagnostics for a launched pinentry. (diff) | |
download | gnupg-309f464a5952c7d7504b875bf4853914b1242346.tar.gz gnupg-309f464a5952c7d7504b875bf4853914b1242346.zip |
agent: Tell the Pinentry the client's pid.
* configure.ac: Check for SO_PEERCRED et al.
* agent/agent.h (server_control_s): Add field 'client_pid'.
* agent/command.c (start_command_handler): Set CLIENT_PID.
* agent/command-ssh.c (get_client_pid): New.
(start_command_handler_ssh): Set CLIENT_PID.
* agent/call-pinentry.c (start_pinentry): Tell Pinentry the client-pid.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 75bed06c4..ce02d037a 100644 --- a/configure.ac +++ b/configure.ac @@ -1375,6 +1375,53 @@ if test $ac_cv_func_mmap != yes -a $mmap_needed = yes; then AC_MSG_ERROR([[Sorry, the current implemenation requires mmap.]]) fi + +# +# Check for the getsockopt SO_PEERCRED +# (This has been copied from libassuan) +# +AC_MSG_CHECKING(for SO_PEERCRED) +AC_CACHE_VAL(gnupg_cv_sys_so_peercred, + [AC_TRY_COMPILE([#include <sys/socket.h>], + [struct ucred cr; + int cl = sizeof cr; + getsockopt (1, SOL_SOCKET, SO_PEERCRED, &cr, &cl);], + gnupg_cv_sys_so_peercred=yes, + gnupg_cv_sys_so_peercred=no) + ]) +AC_MSG_RESULT($gnupg_cv_sys_so_peercred) + +if test $gnupg_cv_sys_so_peercred = yes; then + AC_DEFINE(HAVE_SO_PEERCRED, 1, + [Defined if SO_PEERCRED is supported (Linux specific)]) +else + # Check for the getsockopt LOCAL_PEEREID (NetBSD) + AC_MSG_CHECKING(for LOCAL_PEEREID) + AC_CACHE_VAL(gnupg_cv_sys_so_local_peereid, + [AC_TRY_COMPILE([#include <sys/socket.> + #include <sys/un.h>], + [struct unpcbid unp; + int unpl = sizeof unp; + getsockopt (1, SOL_SOCKET, LOCAL_PEEREID, &unp, &unpl);], + gnupg_cv_sys_so_local_peereid=yes, + gnupg_cv_sys_so_local_peereid=no) + ]) + AC_MSG_RESULT($gnupg_cv_sys_so_local_peereid) + + if test $gnupg_cv_sys_so_local_peereid = yes; then + AC_DEFINE(HAVE_LOCAL_PEEREID, 1, + [Defined if LOCAL_PEEREID is supported (NetBSD specific)]) + else + # (Open)Solaris + AC_CHECK_FUNCS([getpeerucred], AC_CHECK_HEADERS([ucred.h])) + if test $ac_cv_func_getpeerucred != yes; then + # FreeBSD + AC_CHECK_FUNCS([getpeereid]) + fi + fi +fi + + # # W32 specific test # |