1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix bug in which the SSH-only tools (pscp, psftp) did not honour a

nonstandard port number when loading a saved session.

Occurs because those tools include be_none.c which defines no entries
in backends[] at all, as a result of which settings.c doesn't
recognise the word 'ssh' in the saved session's protocol field and
instead sets the protocol to something idiotic - which _then_ means
that when pscp.c forces the protocol to PROT_SSH, it also resets the
port number as it would when overriding a saved session specifying a
protocol other than SSH.

The immediate solution is to define a new be_ssh.c citing only
ssh_backend, and include that in the SSH-only tools. However, I wonder
if a better approach (perhaps when I redesign session loading and
saving) would be not to be so clever, and just have all the tools
contain a complete list of known protocol names for purposes of
understanding what's in the saved session data, and complain if you
try to use one they don't know how to actually speak.

[originally from svn r9254]
This commit is contained in:
Simon Tatham 2011-07-27 18:43:16 +00:00
parent 13c993da07
commit f14953d9e9
3 changed files with 18 additions and 2 deletions

2
Recipe
View File

@ -317,7 +317,7 @@ LIBS = advapi32.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib
# to proxy.c depending on whether we're crypto-avoidant or not.
BE_ALL = be_all cproxy
BE_NOSSH = be_nossh nocproxy
BE_SSH = be_none cproxy
BE_SSH = be_ssh cproxy
BE_NONE = be_none nocproxy
# More backend sets, with the additional Windows serial-port module.
W_BE_ALL = be_all_s winser cproxy

View File

@ -1,6 +1,6 @@
/*
* Linking module for programs that do not support selection of backend
* (such as pscp or pterm).
* (such as pterm).
*/
#include <stdio.h>

16
be_ssh.c Normal file
View File

@ -0,0 +1,16 @@
/*
* Linking module for programs that are restricted to only using SSH
* (pscp and psftp). These do not support selection of backend, but
* must still have a backends[] array mentioning SSH because
* settings.c will want to consult it during session load.
*/
#include <stdio.h>
#include "putty.h"
const int be_default_protocol = PROT_SSH;
Backend *backends[] = {
&ssh_backend,
NULL
};