Patch to 5.1p1 : Log X11 forwarding

Jeff Blaine jblaine at kickflop.net
Sun Feb 8 03:28:53 EST 2009


--- /linus/src/openssh-5.1p1/session.c	2008-06-16 09:29:18.000000000 -0400
+++ session.c	2009-02-07 11:27:37.146134000 -0500
@@ -344,6 +344,7 @@
  			} else {
  				s->screen = 0;
  			}
+
  			packet_check_eom();
  			success = session_setup_x11fwd(s);
  			if (!success) {
@@ -2246,6 +2247,7 @@
  {
  	int success = 0;
  	Session *s;
+	const char *host = NULL;

  	if ((s = session_by_channel(c->self)) == NULL) {
  		logit("session_input_channel_req: no session %d req %.100s",
@@ -2267,6 +2269,10 @@
  			success = session_pty_req(s);
  		} else if (strcmp(rtype, "x11-req") == 0) {
  			success = session_x11_req(s);
+			if (success) {
+				host = get_canonical_hostname(options.use_dns);
+				verbose("X11 forwarding for %s to %s", s->pw->pw_name, host);
+			}
  		} else if (strcmp(rtype, "auth-agent-req at openssh.com") == 0) {
  			success = session_auth_agent_req(s);
  		} else if (strcmp(rtype, "subsystem") == 0) {



More information about the openssh-unix-dev mailing list