]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/blobdiff - config.c
Enable xterm mouse reporting of wheel actions in GTK.
[PuTTY_svn.git] / config.c
index 02da07da6919da3bce81fb9c3ec0696906a4cd0d..2960cab37a5bfebc2e13abbc9a594e61f56b7b36 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1083,9 +1083,23 @@ static void portfwd_handler(union control *ctrl, void *dlg,
                 val != NULL;
                 val = conf_get_str_strs(conf, CONF_portfwd, key, &key)) {
                char *p;
-                if (!strcmp(val, "D"))
-                    p = dupprintf("D%s\t", key+1);
-                else
+                if (!strcmp(val, "D")) {
+                    char *L;
+                    /*
+                     * A dynamic forwarding is stored as L12345=D or
+                     * 6L12345=D (since it's mutually exclusive with
+                     * L12345=anything else), but displayed as D12345
+                     * to match the fiction that 'Local', 'Remote' and
+                     * 'Dynamic' are three distinct modes and also to
+                     * align with OpenSSH's command line option syntax
+                     * that people will already be used to. So, for
+                     * display purposes, find the L in the key string
+                     * and turn it into a D.
+                     */
+                    p = dupprintf("%s\t", key);
+                    L = strchr(p, 'L');
+                    if (L) *L = 'D';
+                } else
                     p = dupprintf("%s\t%s", key, val);
                dlg_listbox_add(ctrl, dlg, p);
                sfree(p);
@@ -1113,8 +1127,8 @@ static void portfwd_handler(union control *ctrl, void *dlg,
            else if (whichbutton == 2)
                family = "6";
            else
-               family = "";
 #endif
+               family = "";
 
            whichbutton = dlg_radiobutton_get(pfd->direction, dlg);
            if (whichbutton == 0)
@@ -1132,7 +1146,7 @@ static void portfwd_handler(union control *ctrl, void *dlg,
            }
            if (*type != 'D') {
                val = dlg_editbox_get(pfd->destbox, dlg);
-               if (!*val || !strchr(val, ':')) {
+               if (!*val || !host_strchr(val, ':')) {
                    dlg_error_msg(dlg,
                                  "You need to specify a destination address\n"
                                  "in the form \"host.name:port\"");
@@ -2085,6 +2099,26 @@ void setup_config_box(struct controlbox *b, int midsession,
                          I(CONF_compression));
        }
 
+       if (!midsession || protcfginfo != 1) {
+           s = ctrl_getset(b, "Connection/SSH", "sharing", "Sharing an SSH connection between PuTTY tools");
+
+           ctrl_checkbox(s, "Share SSH connections if possible", 's',
+                         HELPCTX(ssh_share),
+                         conf_checkbox_handler,
+                         I(CONF_ssh_connection_sharing));
+
+            ctrl_text(s, "Permitted roles in a shared connection:",
+                      HELPCTX(ssh_share));
+           ctrl_checkbox(s, "Upstream (connecting to the real server)", 'u',
+                         HELPCTX(ssh_share),
+                         conf_checkbox_handler,
+                         I(CONF_ssh_connection_sharing_upstream));
+           ctrl_checkbox(s, "Downstream (connecting to the upstream PuTTY)", 'd',
+                         HELPCTX(ssh_share),
+                         conf_checkbox_handler,
+                         I(CONF_ssh_connection_sharing_downstream));
+       }
+
        if (!midsession) {
            s = ctrl_getset(b, "Connection/SSH", "protocol", "Protocol options");
 
@@ -2098,19 +2132,6 @@ void setup_config_box(struct controlbox *b, int midsession,
                              "2 only", 'y', I(3), NULL);
        }
 
-       if (!midsession || protcfginfo != 1) {
-           s = ctrl_getset(b, "Connection/SSH", "encryption", "Encryption options");
-           c = ctrl_draglist(s, "Encryption cipher selection policy:", 's',
-                             HELPCTX(ssh_ciphers),
-                             cipherlist_handler, P(NULL));
-           c->listbox.height = 6;
-
-           ctrl_checkbox(s, "Enable legacy use of single-DES in SSH-2", 'i',
-                         HELPCTX(ssh_ciphers),
-                         conf_checkbox_handler,
-                         I(CONF_ssh2_des_cbc));
-       }
-
        /*
         * The Connection/SSH/Kex panel. (Owing to repeat key
         * exchange, this is all meaningful in mid-session _if_
@@ -2144,6 +2165,26 @@ void setup_config_box(struct controlbox *b, int midsession,
                      HELPCTX(ssh_kex_repeat));
        }
 
+       if (!midsession || protcfginfo != 1) {
+           /*
+            * The Connection/SSH/Cipher panel.
+            */
+           ctrl_settitle(b, "Connection/SSH/Cipher",
+                         "Options controlling SSH encryption");
+
+           s = ctrl_getset(b, "Connection/SSH/Cipher",
+                            "encryption", "Encryption options");
+           c = ctrl_draglist(s, "Encryption cipher selection policy:", 's',
+                             HELPCTX(ssh_ciphers),
+                             cipherlist_handler, P(NULL));
+           c->listbox.height = 6;
+
+           ctrl_checkbox(s, "Enable legacy use of single-DES in SSH-2", 'i',
+                         HELPCTX(ssh_ciphers),
+                         conf_checkbox_handler,
+                         I(CONF_ssh2_des_cbc));
+       }
+
        if (!midsession) {
 
            /*