]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Set cfg.ssh_simple in Windows Plink when there are no forwardings.
authorBen Harris <bjh21@bjh21.me.uk>
Fri, 15 Apr 2016 21:58:26 +0000 (22:58 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Fri, 15 Apr 2016 22:11:59 +0000 (23:11 +0100)
Unix Plink had had this for ages, but for some reason I didn't add it to
Windows Plink at the same time.

unix/uxplink.c
windows/winplink.c

index 3d3a645fbbebae48dfdb339362f185a1314a7f84..7721e4b673349180b1e3767a78323db23e18fd4b 100644 (file)
@@ -961,7 +961,7 @@ int main(int argc, char **argv)
     uxsel_init();
 
     /*
-     * Unix Plink doesn't provide any way to add forwardings after the
+     * Plink doesn't provide any way to add forwardings after the
      * connection is set up, so if there are none now, we can safely set
      * the "simple" flag.
      */
index a0458b39a878b0ad8af99d9a7294e2129b3bf787..99e269fdc106687e7edff5c51fb778ee22d545b7 100644 (file)
@@ -618,6 +618,17 @@ int main(int argc, char **argv)
        return 1;
     }
 
+    /*
+     * Plink doesn't provide any way to add forwardings after the
+     * connection is set up, so if there are none now, we can safely set
+     * the "simple" flag.
+     */
+    if (conf_get_int(conf, CONF_protocol) == PROT_SSH &&
+       !conf_get_int(conf, CONF_x11_forward) &&
+       !conf_get_int(conf, CONF_agentfwd) &&
+       !conf_get_str_nthstrkey(conf, CONF_portfwd, 0))
+       conf_set_int(conf, CONF_ssh_simple, TRUE);
+
     logctx = log_init(NULL, conf);
     console_provide_logctx(logctx);