]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Treat USER specially in event logging of Telnet ENVIRON option; it's
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Wed, 22 Sep 2004 22:38:23 +0000 (22:38 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
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.

[originally from svn r4573]

telnet.c

index 6f4f54ca0f2d5ad91a7e475b4dbfc6507f663a02..5b3404888157793b9b841114cbd3c12aa6226136 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);
        }