1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-24 16:52:24 +00:00

psftp and pscp should disable all forwarding (ports, X, agent).

Partly because that's a good idea _anyway_, and partly because it
seems to be causing trouble. (Specifically, their pathetic attempt
to emulate plink's proper select handling seems to get confused when
the back end tries to open a local listening socket.)

[originally from svn r1264]
This commit is contained in:
Simon Tatham 2001-09-12 20:11:48 +00:00
parent e9adbd2473
commit 7692bf350a
2 changed files with 18 additions and 0 deletions

View File

@ -1710,6 +1710,15 @@ int main(int argc, char *argv[])
/* SFTP uses SSH2 by default always */ /* SFTP uses SSH2 by default always */
cfg.sshprot = 2; cfg.sshprot = 2;
/*
* Disable scary things which shouldn't be enabled for simple
* things like SCP and SFTP: agent forwarding, port forwarding,
* X forwarding.
*/
cfg.x11_forward = 0;
cfg.agentfwd = 0;
cfg.portfwd[0] = cfg.portfwd[1] = '\0';
/* Set up subsystem name. */ /* Set up subsystem name. */
strcpy(cfg.remote_cmd, "sftp"); strcpy(cfg.remote_cmd, "sftp");
cfg.ssh_subsys = TRUE; cfg.ssh_subsys = TRUE;

9
scp.c
View File

@ -603,6 +603,15 @@ static void do_cmd(char *host, char *user, char *cmd)
if (portnumber) if (portnumber)
cfg.port = portnumber; cfg.port = portnumber;
/*
* Disable scary things which shouldn't be enabled for simple
* things like SCP and SFTP: agent forwarding, port forwarding,
* X forwarding.
*/
cfg.x11_forward = 0;
cfg.agentfwd = 0;
cfg.portfwd[0] = cfg.portfwd[1] = '\0';
/* /*
* Attempt to start the SFTP subsystem as a first choice, * Attempt to start the SFTP subsystem as a first choice,
* falling back to the provided scp command if that fails. * falling back to the provided scp command if that fails.