mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-10 07:43:48 -05:00
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.
This commit is contained in:
3
ssh.h
3
ssh.h
@ -44,7 +44,8 @@ void ssh_sharing_remove_x11_display(Ssh ssh, struct X11FakeAuth *auth);
|
||||
void ssh_send_packet_from_downstream(Ssh ssh, unsigned id, int type,
|
||||
const void *pkt, int pktlen,
|
||||
const char *additional_log_text);
|
||||
void ssh_sharing_downstream_connected(Ssh ssh, unsigned id);
|
||||
void ssh_sharing_downstream_connected(Ssh ssh, unsigned id,
|
||||
const char *peerinfo);
|
||||
void ssh_sharing_downstream_disconnected(Ssh ssh, unsigned id);
|
||||
void ssh_sharing_logf(Ssh ssh, unsigned id, const char *logfmt, ...);
|
||||
int ssh_agent_forwarding_permitted(Ssh ssh);
|
||||
|
Reference in New Issue
Block a user