diff options
author | Brian P. Hinz <bphinz@users.sf.net> | 2019-11-03 21:49:53 -0500 |
---|---|---|
committer | Brian P. Hinz <bphinz@users.sf.net> | 2019-11-03 21:51:18 -0500 |
commit | ac61fd85b598284e512500699607871939ae3f34 (patch) | |
tree | 37744d4e26f71bda72646e226c49799def3577e9 /java/com | |
parent | d5c4af7c3c7d640e55590c7da5e3cc4ac1a573fe (diff) | |
download | tigervnc-ac61fd85b598284e512500699607871939ae3f34.tar.gz tigervnc-ac61fd85b598284e512500699607871939ae3f34.zip |
Fix external SSH arguments dialog
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/tigervnc/vncviewer/OptionsDialog.java | 7 | ||||
-rw-r--r-- | java/com/tigervnc/vncviewer/Tunnel.java | 30 |
2 files changed, 18 insertions, 19 deletions
diff --git a/java/com/tigervnc/vncviewer/OptionsDialog.java b/java/com/tigervnc/vncviewer/OptionsDialog.java index d02380cc..c2847a86 100644 --- a/java/com/tigervnc/vncviewer/OptionsDialog.java +++ b/java/com/tigervnc/vncviewer/OptionsDialog.java @@ -622,9 +622,12 @@ class OptionsDialog extends Dialog { extSSH.setParam(extSSHCheckbox.isSelected()); if (!sshClientInput.getText().isEmpty()) extSSHClient.setParam(sshClientInput.getText()); - if (sshArgsDefaultButton.isSelected()) - if (!sshArgsInput.getText().isEmpty()) + if (sshArgsCustomButton.isSelected() && + !sshArgsInput.getText().isEmpty()) { extSSHArgs.setParam(sshArgsInput.getText()); + } else { + extSSHArgs.setParam(new String()); + } if (!sshConfigInput.getText().isEmpty()) sshConfig.setParam(sshConfigInput.getText()); if (!sshKeyFileInput.getText().isEmpty()) diff --git a/java/com/tigervnc/vncviewer/Tunnel.java b/java/com/tigervnc/vncviewer/Tunnel.java index ecb048b7..9b8af136 100644 --- a/java/com/tigervnc/vncviewer/Tunnel.java +++ b/java/com/tigervnc/vncviewer/Tunnel.java @@ -56,17 +56,19 @@ public class Tunnel { String remoteHost, int remotePort, int localPort) throws Exception { - - String pattern = extSSHArgs.getValue(); - if (pattern == null || pattern.isEmpty()) { - if (tunnel.getValue() && via.getValue().isEmpty()) - pattern = System.getProperty("VNC_TUNNEL_CMD"); - else - pattern = System.getProperty("VNC_VIA_CMD"); - } - - if (extSSH.getValue() || - (pattern != null && pattern.length() > 0)) { + if (extSSH.getValue()) { + String pattern = extSSHArgs.getValueStr(); + if (pattern == null || pattern.isEmpty()) { + if (tunnel.getValue() && via.getValue().isEmpty()) { + pattern = System.getProperty("VNC_TUNNEL_CMD"); + if (pattern == null || pattern.isEmpty()) + pattern = DEFAULT_TUNNEL_TEMPLATE; + } else { + pattern = System.getProperty("VNC_VIA_CMD"); + if (pattern == null || pattern.isEmpty()) + pattern = DEFAULT_VIA_TEMPLATE; + } + } createTunnelExt(gatewayHost, remoteHost, remotePort, localPort, pattern); } else { createTunnelJSch(gatewayHost, remoteHost, remotePort, localPort); @@ -202,12 +204,6 @@ public class Tunnel { private static void createTunnelExt(String gatewayHost, String remoteHost, int remotePort, int localPort, String pattern) throws Exception { - if (pattern == null || pattern.length() < 1) { - if (tunnel.getValue() && via.getValue().isEmpty()) - pattern = DEFAULT_TUNNEL_TEMPLATE; - else - pattern = DEFAULT_VIA_TEMPLATE; - } String cmd = fillCmdPattern(pattern, gatewayHost, remoteHost, remotePort, localPort); try { |