Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Rationalise and document log options somewhat.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jtn20 committed Nov 8, 2015
1 parent 222c134 commit a454399
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 7 deletions.
16 changes: 13 additions & 3 deletions cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,19 @@ int cmdline_process_param(const char *p, char *value,
}
}

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);
Expand All @@ -585,7 +596,6 @@ int cmdline_process_param(const char *p, char *value,
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);
Expand Down
14 changes: 14 additions & 0 deletions doc/man-pl.but
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions doc/man-pscp.but
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions doc/man-psft.but
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion doc/man-ptel.but
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion doc/man-pter.but
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 14 additions & 1 deletion doc/man-putt.but
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
3 changes: 3 additions & 0 deletions pscp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,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
Expand Down
3 changes: 3 additions & 0 deletions psftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,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);
}

Expand Down
2 changes: 1 addition & 1 deletion unix/gtkwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -3749,7 +3749,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"
Expand Down
3 changes: 3 additions & 0 deletions unix/uxplink.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,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");
printf(" -shareexists\n");
printf(" test whether a connection-sharing upstream exists\n");
exit(1);
Expand Down
3 changes: 3 additions & 0 deletions windows/winplink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
printf(" -shareexists\n");
printf(" test whether a connection-sharing upstream exists\n");
exit(1);
Expand Down

0 comments on commit a454399

Please sign in to comment.