]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Rationalise and document log options somewhat.
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Sun, 8 Nov 2015 11:57:39 +0000 (11:57 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 29 Feb 2016 19:59:32 +0000 (19:59 +0000)
TOOLTYPE_NONNETWORK (i.e. pterm) already has "-log" (as does Unix
PuTTY), so there's no sense suppressing the synonym "-sessionlog".

Undocumented lacunae that remain:

plink accepts -sessionlog, but does nothing with it. Arguably it should.

puttytel accepts -sshlog/-sshrawlog (and happily logs e.g. Telnet
negotiation, as does PuTTY proper).

(cherry picked from commit a454399ec8d841e627d9d5e05ac977536e776754)

Conflicts:
unix/uxplink.c
windows/winplink.c

(cherry-picker's notes: the conflict was only contextual, in the Plink
help output)

12 files changed:
cmdline.c
doc/man-pl.but
doc/man-pscp.but
doc/man-psft.but
doc/man-ptel.but
doc/man-pter.but
doc/man-putt.but
pscp.c
psftp.c
unix/gtkwin.c
unix/uxplink.c
windows/winplink.c

index bcfdcf88f8ac5f6cec5bd926fe6463126daf17df..9f3360b2bea67e009cafbdd3f70842a1ac1b554d 100644 (file)
--- a/cmdline.c
+++ b/cmdline.c
@@ -573,8 +573,19 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf)
        }
     }
 
-    if (!strcmp(p, "-sessionlog") ||
-        !strcmp(p, "-sshlog") ||
+    if (!strcmp(p, "-sessionlog")) {
+       Filename *fn;
+       RETURN(2);
+       UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER);
+       /* but available even in TOOLTYPE_NONNETWORK, cf pterm "-log" */
+       SAVEABLE(0);
+       fn = filename_from_str(value);
+       conf_set_filename(conf, CONF_logfilename, fn);
+       conf_set_int(conf, CONF_logtype, LGTYP_DEBUG);
+        filename_free(fn);
+    }
+
+    if (!strcmp(p, "-sshlog") ||
         !strcmp(p, "-sshrawlog")) {
        Filename *fn;
        RETURN(2);
@@ -583,7 +594,6 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf)
        fn = filename_from_str(value);
        conf_set_filename(conf, CONF_logfilename, fn);
        conf_set_int(conf, CONF_logtype,
-                     !strcmp(p, "-sessionlog") ? LGTYP_DEBUG :
                      !strcmp(p, "-sshlog") ? LGTYP_PACKETS :
                      /* !strcmp(p, "-sshrawlog") ? */ LGTYP_SSHRAW);
         filename_free(fn);
index 6a358ceaac314fb8f9b693e261ccb878a725b1f1..b597b83f923cb8370a11c7693b7ef6c6f1d993ef 100644 (file)
@@ -184,6 +184,20 @@ DSR/DTR.
 
 }
 
+\dt \cw{\-sshlog} \e{logfile}
+
+\dt \cw{\-sshrawlog} \e{logfile}
+
+\dd For SSH connections, these options make \cw{plink} log protocol
+details to a file. (Some of these may be sensitive, although by default
+an effort is made to suppress obvious passwords.)
+
+\lcont{
+\cw{\-sshlog} logs decoded SSH packets and other events (those that
+\cw{\-v} would print). \cw{\-sshrawlog} additionally logs the raw
+encrypted packet data.
+}
+
 \S{plink-manpage-more-information} MORE INFORMATION
 
 For more information on plink, it's probably best to go and look at
index 5cd5ac8cd33c50a4b0e1a6a12cc669f5d292417a..1b95d4d243f9c3af6015d7196e80dc24e5153c32 100644 (file)
@@ -115,6 +115,20 @@ written. }
 
 \dd Force use of SFTP protocol.
 
+\dt \cw{\-sshlog} \e{logfile}
+
+\dt \cw{\-sshrawlog} \e{logfile}
+
+\dd These options make \cw{pscp} log protocol details to a file.
+(Some of these may be sensitive, although by default an effort is made
+to suppress obvious passwords.)
+
+\lcont{
+\cw{\-sshlog} logs decoded SSH packets and other events (those that
+\cw{\-v} would print). \cw{\-sshrawlog} additionally logs the raw
+encrypted packet data.
+}
+
 \S{pscp-manpage-more-information} MORE INFORMATION
 
 For more information on \cw{pscp} it's probably best to go and look at
index f24d7206c4a10e09f33ee4abf83bc29aca95a05c..0194779a7c26a269fee37f34ddcf78d679d571e6 100644 (file)
@@ -95,6 +95,20 @@ accepted (unless a saved session also overrides host keys, in which
 case those will be added to), and the host key cache will not be
 written. }
 
+\dt \cw{\-sshlog} \e{logfile}
+
+\dt \cw{\-sshrawlog} \e{logfile}
+
+\dd These options make \cw{psftp} log protocol details to a file.
+(Some of these may be sensitive, although by default an effort is made
+to suppress obvious passwords.)
+
+\lcont{
+\cw{\-sshlog} logs decoded SSH packets and other events (those that
+\cw{\-v} would print). \cw{\-sshrawlog} additionally logs the raw
+encrypted packet data.
+}
+
 \S{psftp-manpage-commands} COMMANDS
 
 For a list of commands available inside \cw{psftp}, type \cw{help}
index c0ee9c64eb0cdbbf74faa65c22fc2c6947ad8acd..07a756b112a54eff32701b40807a595652817955 100644 (file)
@@ -109,7 +109,7 @@ changed under control of the server.)
 to specify it explicitly if you have changed the default using the
 \cw{ScrollBar} resource.
 
-\dt \cw{\-log} \e{filename}
+\dt \cw{\-log} \e{logfile}, \cw{\-sessionlog} \e{logfile}
 
 \dd This option makes \cw{puttytel} log all the terminal output to a file
 as well as displaying it in the terminal.
index a357e3e397ae845d3b3a48ce229e0ba77d1aa1d9..26d5842d06f42065aac1c14096a33a8ddf0093ce 100644 (file)
@@ -153,7 +153,7 @@ default using the \cw{LoginShell} resource.
 to specify it explicitly if you have changed the default using the
 \cw{ScrollBar} resource.
 
-\dt \cw{\-log} \e{filename}
+\dt \cw{\-log} \e{logfile}, \cw{\-sessionlog} \e{logfile}
 
 \dd This option makes \cw{pterm} log all the terminal output to a file
 as well as displaying it in the terminal.
index 76694def8ee112e249b10d101cf6b5a45176b771..67bcba83c0fa9338c42b8ce5edc4d880323a2f7e 100644 (file)
@@ -108,11 +108,24 @@ changed under control of the server.)
 to specify it explicitly if you have changed the default using the
 \cw{ScrollBar} resource.
 
-\dt \cw{\-log} \e{filename}
+\dt \cw{\-log} \e{logfile}, \cw{\-sessionlog} \e{logfile}
 
 \dd This option makes \cw{putty} log all the terminal output to a file
 as well as displaying it in the terminal.
 
+\dt \cw{\-sshlog} \e{logfile}
+
+\dt \cw{\-sshrawlog} \e{logfile}
+
+\dd For SSH connections, these options make \cw{putty} log protocol
+details to a file. (Some of these may be sensitive, although by default
+an effort is made to suppress obvious passwords.)
+
+\lcont{
+\cw{\-sshlog} logs decoded SSH packets and other events (those that
+\cw{\-v} would print). \cw{\-sshrawlog} additionally logs the raw
+encrypted packet data.
+}
 
 \dt \cw{\-cs} \e{charset}
 
diff --git a/pscp.c b/pscp.c
index e56d760fbd7f09dc2d45f831fbc16efaea9ba1a6..3e41454d3d4e02c5028f1cab7a83a1c951a31184 100644 (file)
--- a/pscp.c
+++ b/pscp.c
@@ -2262,6 +2262,9 @@ static void usage(void)
     printf("  -unsafe   allow server-side wildcards (DANGEROUS)\n");
     printf("  -sftp     force use of SFTP protocol\n");
     printf("  -scp      force use of SCP protocol\n");
+    printf("  -sshlog file\n");
+    printf("  -sshrawlog file\n");
+    printf("            log protocol details to a file\n");
 #if 0
     /*
      * -gui is an internal option, used by GUI front ends to get
diff --git a/psftp.c b/psftp.c
index 2a82ff8e33bcf8c83b25cd62f95c6aa2125a3d72..7f081ab5680384b4f6f2549412251a1ea75934f2 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -2679,6 +2679,9 @@ static void usage(void)
     printf("  -hostkey aa:bb:cc:...\n");
     printf("            manually specify a host key (may be repeated)\n");
     printf("  -batch    disable all interactive prompts\n");
+    printf("  -sshlog file\n");
+    printf("  -sshrawlog file\n");
+    printf("            log protocol details to a file\n");
     cleanup_exit(1);
 }
 
index 1c29b41eab2d6dc6371a465d82abcf8e82f69a19..12501e694847ff2e74d0122e6f1ae27717c5884a 100644 (file)
@@ -2653,7 +2653,7 @@ static void help(FILE *fp) {
 "  -ut, +ut                  Do(default) or do not update utmp\n"
 "  -ls, +ls                  Do(default) or do not make shell a login shell\n"
 "  -sb, +sb                  Do(default) or do not display a scrollbar\n"
-"  -log PATH                 Log all output to a file\n"
+"  -log PATH, -sessionlog PATH  Log all output to a file\n"
 "  -nethack                  Map numeric keypad to hjklyubn direction keys\n"
 "  -xrm RESOURCE-STRING      Set an X resource\n"
 "  -e COMMAND [ARGS...]      Execute command (consumes all remaining args)\n"
index 6290a2c2a713b7adb2a4bd7fc1debd99591ae058..90ad8d527699f47b5414ddd5e87b70d83dc35939 100644 (file)
@@ -580,6 +580,9 @@ static void usage(void)
     printf("  -N        don't start a shell/command (SSH-2 only)\n");
     printf("  -nc host:port\n");
     printf("            open tunnel in place of session (SSH-2 only)\n");
+    printf("  -sshlog file\n");
+    printf("  -sshrawlog file\n");
+    printf("            log protocol details to a file\n");
     exit(1);
 }
 
index 188d89bb3e08137a60be3e8cd6e16029c22e9812..77a2dc542539676f4f2d14e5c0d42229b52df00d 100644 (file)
@@ -212,6 +212,9 @@ static void usage(void)
     printf("  -N        don't start a shell/command (SSH-2 only)\n");
     printf("  -nc host:port\n");
     printf("            open tunnel in place of session (SSH-2 only)\n");
+    printf("  -sshlog file\n");
+    printf("  -sshrawlog file\n");
+    printf("            log protocol details to a file\n");
     exit(1);
 }