Treat USER specially in event logging of Telnet ENVIRON option; it's
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Wed, 22 Sep 2004 22:38:23 +0000 (22:38 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Wed, 22 Sep 2004 22:38:23 +0000 (22:38 +0000)
occasionally been a pain that the username wasn't visible in the Event Log.

git-svn-id: svn://svn.tartarus.org/sgt/putty@4573 cda61777-01e9-0310-a592-d414129be87e

telnet.c

index 6f4f54c..5b34048 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -518,8 +518,13 @@ static void process_subneg(Telnet telnet)
            b[n++] = IAC;
            b[n++] = SE;
            telnet->bufsize = sk_write(telnet->s, (char *)b, n);
-           logbuf = dupprintf("client:\tSB %s IS %s", telopt(telnet->sb_opt),
-                              n == 6 ? "<nothing>" : "<stuff>");
+           logbuf = dupprintf("client:\tSB %s IS %s%s%s%s",
+                              telopt(telnet->sb_opt),
+                              *telnet->cfg.username ? "USER=" : "",
+                              telnet->cfg.username,
+                              *telnet->cfg.username ? " " : "",
+                              n == 6 ? "<nothing>" :
+                              (*telnet->cfg.environmt ? "<stuff>" : ""));
            logevent(telnet->frontend, logbuf);
            sfree(logbuf);
        }