1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-08 08:58:00 +00:00
putty-source/be_ssh.c
Simon Tatham 91c2e6b4d5 Permit protocol selection in file transfer tools.
PSCP and PSFTP can only work over a protocol enough like SSH to be
able to run subsystems (or at the very least a remote command, for
old-style PSCP). Historically we've implemented this restriction by
having them not support any protocol-selection command-line options at
all, and hardwiring them to instantiating ssh_backend.

This commit regularises them to be more like the rest of the tools.
You can select a protocol using the appropriate command-line option,
provided it's a protocol in those tools' backends[] array. And the
setup code will find the BackendVtable to instantiate by the usual
method of calling backend_vt_from_proto.

Currently, this makes essentially no difference: those tools link in
be_ssh.c, which means the only supported backend is SSH. So the effect
is that now -ssh is an accepted option with no effect, instead of
being rejected. But it opens the way to add other protocols that are
SSH-like enough to run file transfer over.
2020-02-22 18:27:56 +00:00

17 lines
391 B
C

/*
* Linking module for programs that are restricted to only using
* SSH-type protocols (pscp and psftp). These still have a choice of
* two actual backends, because they can also speak PROT_SSHCONN.
*/
#include <stdio.h>
#include "putty.h"
const int be_default_protocol = PROT_SSH;
const struct BackendVtable *const backends[] = {
&ssh_backend,
&sshconn_backend,
NULL
};