psftp and pscp should disable all forwarding (ports, X, agent).
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 12 Sep 2001 20:11:48 +0000 (20:11 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 12 Sep 2001 20:11:48 +0000 (20:11 +0000)
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.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@1264 cda61777-01e9-0310-a592-d414129be87e

psftp.c
scp.c

diff --git a/psftp.c b/psftp.c
index 37f39ff..137320b 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -1710,6 +1710,15 @@ int main(int argc, char *argv[])
     /* SFTP uses SSH2 by default always */
     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. */
     strcpy(cfg.remote_cmd, "sftp");
     cfg.ssh_subsys = TRUE;
diff --git a/scp.c b/scp.c
index 7a8cebd..f4c8d79 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -604,6 +604,15 @@ static void do_cmd(char *host, char *user, char *cmd)
        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,
      * falling back to the provided scp command if that fails.
      */