]> asedeno.scripts.mit.edu Git - PuTTY.git/commit - unix/uxproxy.c
Log identifying information for the other end of connections.
authorSimon Tatham <anakin@pobox.com>
Mon, 18 May 2015 12:57:45 +0000 (13:57 +0100)
committerSimon Tatham <anakin@pobox.com>
Mon, 18 May 2015 13:03:10 +0000 (14:03 +0100)
commitc8f83979a368d10e8def1796cdadd7f8f3bebf74
treeabbc802907b8b467a2899ef8fab7332b149d4123
parent63d7365ae6d1be6facaabad6ecc80cf6650f5d6d
Log identifying information for the other end of connections.

When anyone connects to a PuTTY tool's listening socket - whether it's
a user of a local->remote port forwarding, a connection-sharing
downstream or a client of Pageant - we'd like to log as much
information as we can find out about where the connection came from.

To that end, I've implemented a function sk_peer_info() in the socket
abstraction, which returns a freeform text string as best it can (or
NULL, if it can't get anything at all) describing the thing at the
other end of the connection. For TCP connections, this is done using
getpeername() to get an IP address and port in the obvious way; for
Unix-domain sockets, we attempt SO_PEERCRED (conditionalised on some
moderately hairy autoconfery) to get the pid and owner of the peer. I
haven't implemented anything for Windows named pipes, but I will if I
hear of anything useful.
17 files changed:
Recipe
configure.ac
errsock.c
network.h
pageant.c
portfwd.c
proxy.c
ssh.c
ssh.h
sshshare.c
unix/unix.h
unix/uxnet.c
unix/uxpeer.c [new file with mode: 0644]
unix/uxproxy.c
windows/winhsock.c
windows/winnet.c
windows/winnps.c