summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-11-24 23:11:37 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2013-02-28 14:14:03 +0000
commit8d9b6d472891081d9ff0dc3799a93cdd219f679c (patch)
treed1f62c6aa959cfa95aae16b41efcec228b732104
parentb028cdc93c95bd8766fdca41285aac0cc03770dc (diff)
Add ability to add extra options to the ssh command linexlaunch-20130301-1
-rw-r--r--config.cc2
-rw-r--r--config.h4
-rw-r--r--htmlhelp/IDH_PROGRAM.htm13
-rw-r--r--main.cc11
-rw-r--r--resources/dialog.rc32
-rw-r--r--resources/resources.h2
-rw-r--r--resources/strings.rc2
7 files changed, 46 insertions, 20 deletions
diff --git a/config.cc b/config.cc
index 99fa300..aa89f05 100644
--- a/config.cc
+++ b/config.cc
@@ -95,6 +95,7 @@ void CConfig::Save(const char *filename)
setAttribute(root, "XDMCPTerminate", xdmcpterminate?"True":"False");
setAttribute(root, "SSHKeyChain", keychain?"True":"False");
setAttribute(root, "SSHTerminal", terminal?"True":"False");
+ setAttribute(root, "ExtraSSH", extra_ssh.c_str());
xmlSaveFormatFileEnc(filename, doc, "UTF-8", 1);
@@ -187,6 +188,7 @@ void CConfig::Load(const char *filename)
getAttributeBool(root, "XDMCPTerminate", xdmcpterminate);
getAttributeBool(root, "SSHKeyChain", keychain);
getAttributeBool(root, "SSHTerminal", terminal);
+ getAttribute(root, "ExtraSSH", extra_ssh);
/*free the document */
xmlFreeDoc(doc);
diff --git a/config.h b/config.h
index ae7007f..070c175 100644
--- a/config.h
+++ b/config.h
@@ -48,6 +48,7 @@ struct CConfig
std::string extra_params;
bool keychain;
bool terminal;
+ std::string extra_ssh;
CConfig() : window(MultiWindow),
client(NoClient),
local(true),
@@ -69,7 +70,8 @@ struct CConfig
xdmcpterminate(false),
extra_params(),
keychain(false),
- terminal(true)
+ terminal(true),
+ extra_ssh()
{
};
void Load(const char * filename);
diff --git a/htmlhelp/IDH_PROGRAM.htm b/htmlhelp/IDH_PROGRAM.htm
index e660e1c..8206fdb 100644
--- a/htmlhelp/IDH_PROGRAM.htm
+++ b/htmlhelp/IDH_PROGRAM.htm
@@ -58,7 +58,14 @@ $ keychain -k all
See <b>man keychain</b> for more details.
-<h5><a name="9"></a>Password-less public key authentication</h5>
+<h5><a name="9"></a>Additional parameters for ssh</h5>
+
+Enter any other command line parameters needed by you for the ssh, for example
+-C to enable compression. ssh compression may improve performance on a slow, low-bandwidth
+connection, but will slow things down on fast, high-bandwidth networks.<p>
+If unsure enter nothing.<p>
+
+<h5><a name="10"></a>Password-less public key authentication</h5>
If neither of the options above are selected, you must arrange for
<b>ssh</b> to be able to non-interactively authenticate with the remote
@@ -86,14 +93,14 @@ See the "AUTHORIZED KEYS FILE FORMAT" section of <b>man sshd</b> and
the "IdentityFile" section of <b>man ssh_config</b> for more details.
<p>
-<h5><a name="10"></a>Troubleshooting SSH</h5>
+<h5><a name="11"></a>Troubleshooting SSH</h5>
The command run automatically after the X server has started is
<pre>ssh -Y &lt;user@computer&gt; &lt;program&gt;
</pre>
Try this by hand, from a shell, if you have problems.<p>
-<h4><a name="11"></a>Using rsh</h4>
+<h4><a name="12"></a>Using rsh</h4>
An X client program can be started remotely via rsh.<p>
You must configure rsh for password-less authentication.<p>
diff --git a/main.cc b/main.cc
index 535295b..35f529f 100644
--- a/main.cc
+++ b/main.cc
@@ -186,6 +186,10 @@ class CMyWizard : public CWizard
config.terminal = true;
else
config.terminal = false;
+
+ GetDlgItemText(hwndDlg, IDC_CLIENT_PROTOCOL_EXTRA_PARAMS, buffer, 512);
+ buffer[511] = 0;
+ config.extra_ssh = buffer;
}
// Check for valid input
if ((!config.local && (config.host.empty() || config.remoteprogram.empty())) || config.localprogram.empty())
@@ -363,6 +367,8 @@ class CMyWizard : public CWizard
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_REMOTEPROGRAM_DESC), state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_SSH_TERMINAL), state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_SSH_KEYCHAIN), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROTOCOL_EXTRA_PARAMS_DESC), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROTOCOL_EXTRA_PARAMS), state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROGRAM), !state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROGRAM_DESC), !state);
}
@@ -514,6 +520,7 @@ class CMyWizard : public CWizard
SetDlgItemText(hwndDlg, IDC_CLIENT_HOST, config.host.c_str());
CheckDlgButton(hwndDlg, IDC_CLIENT_SSH_KEYCHAIN, config.keychain?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CLIENT_SSH_TERMINAL, config.terminal?BST_CHECKED:BST_UNCHECKED);
+ SetDlgItemText(hwndDlg, IDC_CLIENT_PROTOCOL_EXTRA_PARAMS, config.extra_ssh.c_str());
break;
case IDD_XDMCP:
psp->dwFlags |= PSP_HASHELP;
@@ -672,8 +679,8 @@ class CMyWizard : public CWizard
if (config.protocol == "ssh")
{
- snprintf(cmdline,512,"ssh -Y %s %s",
- host.c_str(),config.remoteprogram.c_str());
+ snprintf(cmdline,512,"ssh -Y %s %s %s",
+ host.c_str(), config.extra_ssh.c_str(), config.remoteprogram.c_str());
client = cmdline;
if (config.keychain)
diff --git a/resources/dialog.rc b/resources/dialog.rc
index cbf6562..3f55a5a 100644
--- a/resources/dialog.rc
+++ b/resources/dialog.rc
@@ -69,26 +69,30 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSM
CAPTION STR_CAPTION_PROGRAM
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- AUTORADIOBUTTON STR_CLIENT_LOCAL,IDC_CLIENT_LOCAL,7,14,300,10
- AUTORADIOBUTTON STR_CLIENT_REMOTE,IDC_CLIENT_REMOTE,7,50,300,10
+ AUTORADIOBUTTON STR_CLIENT_LOCAL,IDC_CLIENT_LOCAL,7,0,300,10
+ AUTORADIOBUTTON STR_CLIENT_REMOTE,IDC_CLIENT_REMOTE,7,27,300,10
- LTEXT STR_CLIENT_PROGRAM_DESC,IDC_CLIENT_PROGRAM_DESC,19,28,64,10
- COMBOBOX IDC_CLIENT_PROGRAM,100,26,64,54,CBS_DROPDOWN | WS_VSCROLL
+ LTEXT STR_CLIENT_PROGRAM_DESC,IDC_CLIENT_PROGRAM_DESC,19,14,64,10
+ COMBOBOX IDC_CLIENT_PROGRAM,100,12,200,54,CBS_DROPDOWN | WS_VSCROLL
- LTEXT STR_CLIENT_PROTOCOL_DESC,IDC_CLIENT_PROTOCOL_DESC,19,64,70,10
- COMBOBOX IDC_CLIENT_PROTOCOL,100,62,64,54,CBS_DROPDOWNLIST | WS_VSCROLL
+ LTEXT STR_CLIENT_PROTOCOL_DESC,IDC_CLIENT_PROTOCOL_DESC,19,40,70,10
+ COMBOBOX IDC_CLIENT_PROTOCOL,100,38,64,54,CBS_DROPDOWNLIST | WS_VSCROLL
- LTEXT STR_CLIENT_REMOTEPROGRAM_DESC,IDC_CLIENT_REMOTEPROGRAM_DESC,19,78,70,10
- EDITTEXT IDC_CLIENT_REMOTEPROGRAM,100,76,200,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
+ LTEXT STR_CLIENT_REMOTEPROGRAM_DESC,IDC_CLIENT_REMOTEPROGRAM_DESC,19,54,70,10
+ EDITTEXT IDC_CLIENT_REMOTEPROGRAM,100,52,200,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
- LTEXT STR_CLIENT_HOST_DESC,IDC_CLIENT_HOST_DESC,19,92,70,10
- EDITTEXT IDC_CLIENT_HOST,100,90,64,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
+ LTEXT STR_CLIENT_HOST_DESC,IDC_CLIENT_HOST_DESC,19,68,70,10
+ EDITTEXT IDC_CLIENT_HOST,100,66,64,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
- LTEXT STR_CLIENT_USER_DESC,IDC_CLIENT_USER_DESC,19,106,70,10
- EDITTEXT IDC_CLIENT_USER,100,104,64,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
+ LTEXT STR_CLIENT_USER_DESC,IDC_CLIENT_USER_DESC,19,82,70,10
+ EDITTEXT IDC_CLIENT_USER,100,80,64,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
+
+ AUTOCHECKBOX STR_CLIENT_KEYCHAIN,IDC_CLIENT_SSH_KEYCHAIN,19,96,200,12,BS_MULTILINE|BS_TOP|WS_TABSTOP|WS_GROUP
+ AUTOCHECKBOX STR_CLIENT_TERMINAL,IDC_CLIENT_SSH_TERMINAL,19,109,200,12,BS_MULTILINE|BS_TOP|WS_TABSTOP|WS_GROUP
+
+ LTEXT STR_CLIENT_PROTOCOL_EXTRA_PARAMS_DESC,IDC_CLIENT_PROTOCOL_EXTRA_PARAMS_DESC,19,120,280,10
+ EDITTEXT IDC_CLIENT_PROTOCOL_EXTRA_PARAMS,19,130,281,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
- AUTOCHECKBOX STR_CLIENT_KEYCHAIN,IDC_CLIENT_SSH_KEYCHAIN,19,120,200,12,BS_MULTILINE|BS_TOP|WS_TABSTOP|WS_GROUP
- AUTOCHECKBOX STR_CLIENT_TERMINAL,IDC_CLIENT_SSH_TERMINAL,19,134,200,12,BS_MULTILINE|BS_TOP|WS_TABSTOP|WS_GROUP
END
IDD_XDMCP DIALOGEX 0, 0, 317, 143
diff --git a/resources/resources.h b/resources/resources.h
index eef0df7..e8bca5a 100644
--- a/resources/resources.h
+++ b/resources/resources.h
@@ -73,6 +73,8 @@
#define IDC_CLIENT_REMOTEPROGRAM_DESC 233
#define IDC_CLIENT_SSH_KEYCHAIN 234
#define IDC_CLIENT_SSH_TERMINAL 235
+#define IDC_CLIENT_PROTOCOL_EXTRA_PARAMS_DESC 236
+#define IDC_CLIENT_PROTOCOL_EXTRA_PARAMS 237
#define IDC_FONTPATH_DESC 240
diff --git a/resources/strings.rc b/resources/strings.rc
index 2c384b8..c42fbe6 100644
--- a/resources/strings.rc
+++ b/resources/strings.rc
@@ -51,6 +51,8 @@
#define STR_CLIENT_KEYCHAIN "Use keychain to contact ssh-agent"
#define STR_CLIENT_TERMINAL "Prompt for ssh password/passphrase"
+#define STR_CLIENT_PROTOCOL_EXTRA_PARAMS_DESC "Additional parameters for ssh"
+
#define STR_CAPTION_XDMCP "XDMCP settings"
#define STR_XDMCP_QUERY "Connect to host"
#define STR_XDMCP_INDIRECT "Use indirect connect"