aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/xlaunch
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-07 16:07:34 +0000
committermarha <marha@users.sourceforge.net>2011-03-07 16:07:34 +0000
commit41467367b93dff68246a6656d82e892184a520ea (patch)
tree952d10b0028b59a268075b4cd488632c538bb916 /xorg-server/hw/xwin/xlaunch
parentc7dc52700eea5353a1ec23331ebb81d671442c8c (diff)
downloadvcxsrv-41467367b93dff68246a6656d82e892184a520ea.tar.gz
vcxsrv-41467367b93dff68246a6656d82e892184a520ea.tar.bz2
vcxsrv-41467367b93dff68246a6656d82e892184a520ea.zip
Starting remote program works.
Added option to disable access control.
Diffstat (limited to 'xorg-server/hw/xwin/xlaunch')
-rw-r--r--xorg-server/hw/xwin/xlaunch/config.cc373
-rw-r--r--xorg-server/hw/xwin/xlaunch/config.h42
-rw-r--r--xorg-server/hw/xwin/xlaunch/main.cc70
-rw-r--r--xorg-server/hw/xwin/xlaunch/resources/dialog.rc37
-rw-r--r--xorg-server/hw/xwin/xlaunch/resources/resources.h8
-rw-r--r--xorg-server/hw/xwin/xlaunch/resources/strings.rc9
6 files changed, 289 insertions, 250 deletions
diff --git a/xorg-server/hw/xwin/xlaunch/config.cc b/xorg-server/hw/xwin/xlaunch/config.cc
index 3be68b0b3..45dfea745 100644
--- a/xorg-server/hw/xwin/xlaunch/config.cc
+++ b/xorg-server/hw/xwin/xlaunch/config.cc
@@ -1,189 +1,196 @@
-/*
- * Copyright (c) 2005 Alexander Gottwald
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include "config.h"
-#include "window/util.h"
-#include <stdexcept>
-
-xmlDocPtr CreateDocument()
-{
- xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
- xmlNodePtr root_node = xmlNewNode(NULL, BAD_CAST "XLaunch");
- xmlDocSetRootElement(doc, root_node);
-
- return doc;
-
-}
-
-void setAttribute(xmlNodePtr elem, const char *name, const char *value)
-{
- xmlNewProp(elem, BAD_CAST name, BAD_CAST value);
-}
-
-void CConfig::Save(const char *filename)
-{
- xmlDocPtr doc = CreateDocument();
- xmlNodePtr root = xmlDocGetRootElement(doc);
-
- switch (window)
- {
- case MultiWindow:
- setAttribute(root, "WindowMode", "MultiWindow");
- break;
- case Fullscreen:
- setAttribute(root, "WindowMode", "Fullscreen");
- break;
- default:
- case Windowed:
- setAttribute(root, "WindowMode", "Windowed");
- break;
- case Nodecoration:
- setAttribute(root, "WindowMode", "Nodecoration");
- break;
- }
- switch (client)
- {
- default:
- case NoClient:
- setAttribute(root, "ClientMode", "NoClient");
- break;
- case StartProgram:
- setAttribute(root, "ClientMode", "StartProgram");
- break;
- case XDMCP:
- setAttribute(root, "ClientMode", "XDMCP");
- break;
- }
- setAttribute(root, "LocalClient", local?"True":"False");
- setAttribute(root, "Display", display.c_str());
- setAttribute(root, "Program", program.c_str());
- setAttribute(root, "RemoteProtocol", protocol.c_str());
- setAttribute(root, "RemoteHost", host.c_str());
- setAttribute(root, "RemoteUser", user.c_str());
- setAttribute(root, "XDMCPHost", xdmcp_host.c_str());
- setAttribute(root, "XDMCPBroadcast", broadcast?"True":"False");
- setAttribute(root, "XDMCPIndirect", indirect?"True":"False");
- setAttribute(root, "Clipboard", clipboard?"True":"False");
- setAttribute(root, "ClipboardPrimary", clipboardprimary?"True":"False");
- setAttribute(root, "ExtraParams", extra_params.c_str());
- setAttribute(root, "Wgl", wgl?"True":"False");
-
- xmlSaveFormatFileEnc(filename, doc, "UTF-8", 1);
-
- /*free the document */
- xmlFreeDoc(doc);
+/*
+ * Copyright (c) 2005 Alexander Gottwald
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include "config.h"
+#include "window/util.h"
+#include <stdexcept>
+
+xmlDocPtr CreateDocument()
+{
+ xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
+ xmlNodePtr root_node = xmlNewNode(NULL, BAD_CAST "XLaunch");
+ xmlDocSetRootElement(doc, root_node);
+
+ return doc;
+
+}
+
+void setAttribute(xmlNodePtr elem, const char *name, const char *value)
+{
+ xmlNewProp(elem, BAD_CAST name, BAD_CAST value);
+}
+
+void CConfig::Save(const char *filename)
+{
+ xmlDocPtr doc = CreateDocument();
+ xmlNodePtr root = xmlDocGetRootElement(doc);
+
+ switch (window)
+ {
+ case MultiWindow:
+ setAttribute(root, "WindowMode", "MultiWindow");
+ break;
+ case Fullscreen:
+ setAttribute(root, "WindowMode", "Fullscreen");
+ break;
+ default:
+ case Windowed:
+ setAttribute(root, "WindowMode", "Windowed");
+ break;
+ case Nodecoration:
+ setAttribute(root, "WindowMode", "Nodecoration");
+ break;
+ }
+ switch (client)
+ {
+ default:
+ case NoClient:
+ setAttribute(root, "ClientMode", "NoClient");
+ break;
+ case StartProgram:
+ setAttribute(root, "ClientMode", "StartProgram");
+ break;
+ case XDMCP:
+ setAttribute(root, "ClientMode", "XDMCP");
+ break;
+ }
+ setAttribute(root, "LocalClient", local?"True":"False");
+ setAttribute(root, "Display", display.c_str());
+ setAttribute(root, "LocalProgram", localprogram.c_str());
+ setAttribute(root, "RemoteProgram", remoteprogram.c_str());
+ setAttribute(root, "RemotePassword", remotepassword.c_str());
+ setAttribute(root, "RemoteHost", host.c_str());
+ setAttribute(root, "RemoteUser", user.c_str());
+ setAttribute(root, "XDMCPHost", xdmcp_host.c_str());
+ setAttribute(root, "XDMCPBroadcast", broadcast?"True":"False");
+ setAttribute(root, "XDMCPIndirect", indirect?"True":"False");
+ setAttribute(root, "Clipboard", clipboard?"True":"False");
+ setAttribute(root, "ClipboardPrimary", clipboardprimary?"True":"False");
+ setAttribute(root, "ExtraParams", extra_params.c_str());
+ setAttribute(root, "Wgl", wgl?"True":"False");
+ setAttribute(root, "DisableAC", disableac?"True":"False");
+
+ xmlSaveFormatFileEnc(filename, doc, "UTF-8", 1);
+
+ /*free the document */
+ xmlFreeDoc(doc);
/*
*Free the global variables that may
*have been allocated by the parser.
*/
xmlCleanupParser();
-}
-
-BOOL getAttribute(xmlNodePtr elem, const char *name, std::string &ret)
-{
- ret=(char*)xmlGetProp(elem,BAD_CAST name);
- return true;
-}
-
-BOOL getAttributeBool(xmlNodePtr elem, const char *name, bool &ret)
-{
- const char *pVal=(char*)xmlGetProp(elem, BAD_CAST name);
- if (!pVal)
- return false;
-
- std::string str(pVal);
-
- if (str == "True")
- ret = true;
- else
- ret = false;
- return true;
-}
-
-
-void CConfig::Load(const char *filename)
-{
- xmlDocPtr doc = xmlReadFile(filename, NULL, 0);
-
- xmlNodePtr root;
-
- if (doc == NULL)
- {
- return;
- }
-
- root = xmlDocGetRootElement(doc);
-
- std::string windowMode;
- std::string clientMode;
-
- if (getAttribute(root, "WindowMode", windowMode))
- {
- if (windowMode == "MultiWindow")
- window = MultiWindow;
- else if (windowMode == "Fullscreen")
- window = Fullscreen;
- else if (windowMode == "Windowed")
- window = Windowed;
- else if (windowMode == "Nodecoration")
- window = Nodecoration;
- }
- if (getAttribute(root, "ClientMode", clientMode))
- {
- if (clientMode == "NoClient")
- client = NoClient;
- else if (clientMode == "StartProgram")
- client = StartProgram;
- else if (clientMode == "XDMCP")
- client = XDMCP;
- }
-
- getAttributeBool(root, "LocalClient", local);
- getAttribute(root, "Display", display);
- getAttribute(root, "Program", program);
- getAttribute(root, "RemoteProtocol", protocol);
- getAttribute(root, "RemoteHost", host);
- getAttribute(root, "RemoteUser", user);
- getAttribute(root, "XDMCPHost", xdmcp_host);
- getAttributeBool(root, "XDMCPBroadcast", broadcast);
- getAttributeBool(root, "XDMCPIndirect", indirect);
- getAttributeBool(root, "Clipboard", clipboard);
- getAttributeBool(root, "ClipboardPrimary", clipboardprimary);
- getAttribute(root, "ExtraParams", extra_params);
- getAttributeBool(root, "Wgl", wgl);
-
- /*free the document */
- xmlFreeDoc(doc);
-
- /*
- *Free the global variables that may
- *have been allocated by the parser.
- */
- xmlCleanupParser();
-}
-
+}
+
+BOOL getAttribute(xmlNodePtr elem, const char *name, std::string &ret)
+{
+ char *pVal=(char*)xmlGetProp(elem,BAD_CAST name);
+ if (!pVal)
+ return false;
+ ret=pVal;
+ return true;
+}
+
+BOOL getAttributeBool(xmlNodePtr elem, const char *name, bool &ret)
+{
+ const char *pVal=(char*)xmlGetProp(elem, BAD_CAST name);
+ if (!pVal)
+ return false;
+
+ std::string str(pVal);
+
+ if (str == "True")
+ ret = true;
+ else
+ ret = false;
+ return true;
+}
+
+
+void CConfig::Load(const char *filename)
+{
+ xmlDocPtr doc = xmlReadFile(filename, NULL, 0);
+
+ xmlNodePtr root;
+
+ if (doc == NULL)
+ {
+ return;
+ }
+
+ root = xmlDocGetRootElement(doc);
+
+ std::string windowMode;
+ std::string clientMode;
+
+ if (getAttribute(root, "WindowMode", windowMode))
+ {
+ if (windowMode == "MultiWindow")
+ window = MultiWindow;
+ else if (windowMode == "Fullscreen")
+ window = Fullscreen;
+ else if (windowMode == "Windowed")
+ window = Windowed;
+ else if (windowMode == "Nodecoration")
+ window = Nodecoration;
+ }
+ if (getAttribute(root, "ClientMode", clientMode))
+ {
+ if (clientMode == "NoClient")
+ client = NoClient;
+ else if (clientMode == "StartProgram")
+ client = StartProgram;
+ else if (clientMode == "XDMCP")
+ client = XDMCP;
+ }
+
+ getAttributeBool(root, "LocalClient", local);
+ getAttribute(root, "Display", display);
+ getAttribute(root, "LocalProgram", localprogram);
+ getAttribute(root, "RemoteProgram", remoteprogram);
+ getAttribute(root, "RemotePassword", remotepassword);
+ getAttribute(root, "RemoteHost", host);
+ getAttribute(root, "RemoteUser", user);
+ getAttribute(root, "XDMCPHost", xdmcp_host);
+ getAttributeBool(root, "XDMCPBroadcast", broadcast);
+ getAttributeBool(root, "XDMCPIndirect", indirect);
+ getAttributeBool(root, "Clipboard", clipboard);
+ getAttributeBool(root, "ClipboardPrimary", clipboardprimary);
+ getAttribute(root, "ExtraParams", extra_params);
+ getAttributeBool(root, "Wgl", wgl);
+ getAttributeBool(root, "DisableAC", disableac);
+
+ /*free the document */
+ xmlFreeDoc(doc);
+
+ /*
+ *Free the global variables that may
+ *have been allocated by the parser.
+ */
+ xmlCleanupParser();
+}
+
diff --git a/xorg-server/hw/xwin/xlaunch/config.h b/xorg-server/hw/xwin/xlaunch/config.h
index 9c4fc0b1a..54ce69764 100644
--- a/xorg-server/hw/xwin/xlaunch/config.h
+++ b/xorg-server/hw/xwin/xlaunch/config.h
@@ -42,40 +42,44 @@ struct CConfig
{
enum {MultiWindow, Fullscreen, Windowed, Nodecoration} window;
enum {NoClient, StartProgram, XDMCP} client;
- enum {NoXClient, Local, PuTTY, OpenSSH} clientstart;
bool local;
std::string display;
- std::string protocol;
- std::string protocol_path;
- std::string program;
- std::vector<std::string> progs;
+ std::string localprogram;
+ std::string remoteprogram;
bool compress;
std::string host;
std::string user;
- std::string password;
- bool password_save;
- bool password_start;
+ std::string remotepassword;
bool broadcast;
bool indirect;
std::string xdmcp_host;
- std::vector<std::string> xhosts;
bool clipboard;
bool clipboardprimary;
bool wgl;
- bool no_access_control;
- std::string font_server;
+ bool disableac;
std::string extra_params;
- std::string extra_ssh;
#ifdef _DEBUG
- CConfig() : window(MultiWindow), client(NoClient), clientstart(NoXClient), display("1"),
+ CConfig() : window(MultiWindow), client(NoClient), display("1"),
#else
- CConfig() : window(MultiWindow), client(NoClient), clientstart(NoXClient), display("0"),
+ CConfig() : window(MultiWindow), client(NoClient), display("0"),
#endif
- local(false), protocol(""),
- protocol_path(""), program("xcalc"), progs(PROG_NUMBER), compress(false), host(""), user("ago"),
- password(""), password_save(false), password_start(false), broadcast(false),
- indirect(false), xdmcp_host(""), xhosts(HOST_NUMBER), clipboard(true), clipboardprimary(true), no_access_control(false),
- font_server(), extra_params(), extra_ssh(), wgl(true) {};
+ local(false),
+ remotepassword(""),
+ localprogram("xcalc"),
+ remoteprogram("xterm"),
+ compress(false),
+ host(""),
+ user(""),
+ broadcast(false),
+ indirect(false),
+ xdmcp_host(""),
+ clipboard(true),
+ clipboardprimary(true),
+ extra_params(),
+ disableac(false),
+ wgl(true)
+ {
+ };
void Load(const char * filename);
void Save(const char * filename);
};
diff --git a/xorg-server/hw/xwin/xlaunch/main.cc b/xorg-server/hw/xwin/xlaunch/main.cc
index 8b0f00579..a8529b5f9 100644
--- a/xorg-server/hw/xwin/xlaunch/main.cc
+++ b/xorg-server/hw/xwin/xlaunch/main.cc
@@ -158,10 +158,16 @@ class CMyWizard : public CWizard
config.host = buffer;
GetDlgItemText(hwndDlg, IDC_CLIENT_PROGRAM, buffer, 512);
buffer[511] = 0;
- config.program = buffer;
+ config.localprogram = buffer;
+ GetDlgItemText(hwndDlg, IDC_CLIENT_REMOTEPROGRAM, buffer, 512);
+ buffer[511] = 0;
+ config.remoteprogram = buffer;
+ GetDlgItemText(hwndDlg, IDC_CLIENT_PASSWORD, buffer, 512);
+ buffer[511] = 0;
+ config.remotepassword = buffer;
}
// Check for valid input
- if (!config.local && (config.host.empty() || config.program.empty()))
+ if (!config.local && (config.host.empty() || config.localprogram.empty() || config.remoteprogram.empty()))
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
else
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_EXTRA);
@@ -211,6 +217,11 @@ class CMyWizard : public CWizard
config.wgl = true;
else
config.wgl = false;
+ // check for wgl
+ if (IsDlgButtonChecked(hwndDlg, IDC_DISABLEAC))
+ config.disableac = true;
+ else
+ config.disableac = false;
// read parameters
{
char buffer[512];
@@ -303,12 +314,16 @@ class CMyWizard : public CWizard
/// @param state State of control group.
void EnableRemoteProgramGroup(HWND hwndDlg, BOOL state)
{
- EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROTOCOL), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PASSWORD), state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_HOST), state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_USER), state);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROTOCOL_DESC), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PASSWORD_DESC), state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_HOST_DESC), state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_USER_DESC), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_REMOTEPROGRAM), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_REMOTEPROGRAM_DESC), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROGRAM), !state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROGRAM_DESC), !state);
}
/// @brief Enable or disable the control for XDMCP connection.
/// @param hwndDlg Handle to active page dialog.
@@ -331,18 +346,6 @@ class CMyWizard : public CWizard
SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xwininfo");
SendMessage(cbwnd, CB_SETCURSEL, 0, 0);
}
- /// @brief Fill protocol box with default values.
- /// @param hwndDlg Handle to active page dialog.
- void FillProtocolBox(HWND hwndDlg)
- {
- HWND cbwnd = GetDlgItem(hwndDlg, IDC_CLIENT_PROTOCOL);
- if (cbwnd == NULL)
- return;
- SendMessage(cbwnd, CB_RESETCONTENT, 0, 0);
- SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "Putty");
- //SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "OpenSSH");
- SendMessage(cbwnd, CB_SETCURSEL, 0, 0);
- }
void ShowSaveDialog(HWND parent)
{
char szTitle[512];
@@ -444,12 +447,14 @@ class CMyWizard : public CWizard
EnableRemoteProgramGroup(hwndDlg, config.local?FALSE:TRUE);
// Fill combo boxes
FillProgramBox(hwndDlg);
- FillProtocolBox(hwndDlg);
// Set edit fields
- if (!config.program.empty())
- SetDlgItemText(hwndDlg, IDC_CLIENT_PROGRAM, config.program.c_str());
+ if (!config.localprogram.empty())
+ SetDlgItemText(hwndDlg, IDC_CLIENT_PROGRAM, config.localprogram.c_str());
+ if (!config.remoteprogram.empty())
+ SetDlgItemText(hwndDlg, IDC_CLIENT_REMOTEPROGRAM, config.remoteprogram.c_str());
SetDlgItemText(hwndDlg, IDC_CLIENT_USER, config.user.c_str());
SetDlgItemText(hwndDlg, IDC_CLIENT_HOST, config.host.c_str());
+ SetDlgItemText(hwndDlg, IDC_CLIENT_PASSWORD, config.remotepassword.c_str());
break;
case IDD_XDMCP:
// Init XDMCP dialog. Check broadcast and indirect button
@@ -463,6 +468,7 @@ class CMyWizard : public CWizard
CheckDlgButton(hwndDlg, IDC_CLIPBOARD, config.clipboard?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CLIPBOARDPRIMARY, config.clipboardprimary?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_WGL, config.wgl?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEAC, config.disableac?BST_CHECKED:BST_UNCHECKED);
SetDlgItemText(hwndDlg, IDC_EXTRA_PARAMS, config.extra_params.c_str());
break;
@@ -556,7 +562,7 @@ class CMyWizard : public CWizard
else
buffer += "-query ";
buffer += config.xdmcp_host;
- buffer += " ";
+ buffer += " ";
}
}
if (config.clipboard)
@@ -565,6 +571,8 @@ class CMyWizard : public CWizard
buffer += "-noclipboardprimary ";
if (config.wgl)
buffer += "-wgl ";
+ if (config.disableac)
+ buffer += "-ac ";
if (!config.extra_params.empty())
{
buffer += config.extra_params;
@@ -578,19 +586,18 @@ class CMyWizard : public CWizard
{
char cmdline[512];
std::string host = config.host;
+ std::string remotepassword;
if (!config.user.empty())
host = config.user + "@" + config.host;
- if (config.protocol == "Putty")
- _snprintf(cmdline,512,"plink -X %s %s",
- host.c_str(),config.program.c_str());
- else
- _snprintf(cmdline,512,"ssh -Y %s %s",
- host.c_str(),config.program.c_str());
+ if (!config.remotepassword.empty())
+ remotepassword=std::string(" -pw ")+config.remotepassword;
+ _snprintf(cmdline,512,"plink -ssh -X%s %s %s",
+ remotepassword.c_str(), host.c_str(),config.remoteprogram.c_str());
client += cmdline;
}
else
{
- client += config.program.c_str();
+ client += config.localprogram.c_str();
}
}
@@ -639,7 +646,7 @@ class CMyWizard : public CWizard
// FIXME: This may make it impossible to enter the password
sic.dwFlags = STARTF_USESHOWWINDOW;
sic.wShowWindow = SW_HIDE;
-
+
// Start the child process.
if( !CreateProcess( NULL, (CHAR*)client.c_str(), NULL, NULL,
FALSE, 0, NULL, NULL, &sic, &pic ))
@@ -658,7 +665,9 @@ class CMyWizard : public CWizard
#ifdef _DEBUG
printf("killing process!\n");
#endif
- // Check if Xsrv is still running
+ // Check if Xsrv is still running, but only when we started a local program
+ if (0)
+ {
DWORD exitcode;
GetExitCodeProcess(pi.hProcess, &exitcode);
unsigned counter = 0;
@@ -673,7 +682,8 @@ class CMyWizard : public CWizard
GetExitCodeProcess(pi.hProcess, &exitcode);
}
// Kill the client
- TerminateProcess(pic.hProcess, (DWORD)-1);
+ TerminateProcess(pic.hProcess, (DWORD)-1);
+ }
// Close process and thread handles.
CloseHandle( pi.hProcess );
diff --git a/xorg-server/hw/xwin/xlaunch/resources/dialog.rc b/xorg-server/hw/xwin/xlaunch/resources/dialog.rc
index e432d724b..689576b2a 100644
--- a/xorg-server/hw/xwin/xlaunch/resources/dialog.rc
+++ b/xorg-server/hw/xwin/xlaunch/resources/dialog.rc
@@ -68,19 +68,25 @@ 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
- LTEXT STR_CLIENT_PROGRAM_DESC,IDC_CLIENT_PROGRAM_DESC,7,14,64,10
- COMBOBOX IDC_CLIENT_PROGRAM,70,12,64,54,CBS_DROPDOWN | WS_VSCROLL
+ AUTORADIOBUTTON STR_CLIENT_LOCAL,IDC_CLIENT_LOCAL,7,14,300,10
+ AUTORADIOBUTTON STR_CLIENT_REMOTE,IDC_CLIENT_REMOTE,7,50,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
- AUTORADIOBUTTON STR_CLIENT_LOCAL,IDC_CLIENT_LOCAL,7,28,300,10
- AUTORADIOBUTTON STR_CLIENT_REMOTE,IDC_CLIENT_REMOTE,7,42,300,10
- LTEXT STR_CLIENT_PROTOCOL_DESC,IDC_CLIENT_PROTOCOL_DESC,19,56,70,10
- COMBOBOX IDC_CLIENT_PROTOCOL,100,54,64,54,CBS_DROPDOWNLIST | WS_VSCROLL
+ LTEXT STR_CLIENT_REMOTEPROGRAM_DESC,IDC_CLIENT_REMOTEPROGRAM_DESC,19,64,70,10
+ EDITTEXT IDC_CLIENT_REMOTEPROGRAM,100,62,200,12
+
+ LTEXT STR_CLIENT_PASSWORD_DESC,IDC_CLIENT_PASSWORD_DESC,19,78,70,10
+ EDITTEXT IDC_CLIENT_PASSWORD,100,76,64,12
- LTEXT STR_CLIENT_HOST_DESC,IDC_CLIENT_HOST_DESC,19,70,70,10
- LTEXT STR_CLIENT_USER_DESC,IDC_CLIENT_USER_DESC,19,84,70,10
- EDITTEXT IDC_CLIENT_HOST,100,68,64,12
- EDITTEXT IDC_CLIENT_USER,100,82,64,12
+
+ LTEXT STR_CLIENT_HOST_DESC,IDC_CLIENT_HOST_DESC,19,92,70,10
+ EDITTEXT IDC_CLIENT_HOST,100,90,64,12
+
+ LTEXT STR_CLIENT_USER_DESC,IDC_CLIENT_USER_DESC,19,106,70,10
+ EDITTEXT IDC_CLIENT_USER,100,104,64,12
END
IDD_XDMCP DIALOGEX 0, 0, 317, 143
@@ -106,11 +112,14 @@ BEGIN
AUTOCHECKBOX STR_CLIPBOARDPRIMARY,IDC_CLIPBOARDPRIMARY,19,30,300,10
LTEXT STR_CLIPBOARDPRIMARY_DESC,IDC_CLIPBOARDPRIMARY_DESC,31,40,280,27
- AUTOCHECKBOX STR_WGL,IDC_WGL,7,56,300,10
- LTEXT STR_WGL_DESC,IDC_WGL_DESC,19,66,280,27
+ AUTOCHECKBOX STR_WGL,IDC_DISABLEAC,7,52,300,10
+ LTEXT STR_WGL_DESC,IDC_WGL_DESC,19,62,280,27
+
+ AUTOCHECKBOX STR_DISABLEAC,IDC_WGL,7,82,300,10
+ LTEXT STR_DISABLEAC_DESC,IDC_DISABLEAC_DESC,19,92,280,27
- LTEXT STR_EXTRA_PARAMS_DESC,IDC_EXTRA_PARAMS_DESC,7,95,280,10
- EDITTEXT IDC_EXTRA_PARAMS,7,105,300,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
+ LTEXT STR_EXTRA_PARAMS_DESC,IDC_EXTRA_PARAMS_DESC,7,105,280,10
+ EDITTEXT IDC_EXTRA_PARAMS,7,115,300,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL
END
IDD_FINISH DIALOGEX 0, 0, 317, 143
diff --git a/xorg-server/hw/xwin/xlaunch/resources/resources.h b/xorg-server/hw/xwin/xlaunch/resources/resources.h
index 93a9bbf44..3df186d3b 100644
--- a/xorg-server/hw/xwin/xlaunch/resources/resources.h
+++ b/xorg-server/hw/xwin/xlaunch/resources/resources.h
@@ -73,7 +73,7 @@
#define IDC_CLIENT_REMOTE 214
#define IDC_CLIENT_HOST 215
#define IDC_CLIENT_USER 216
-#define IDC_CLIENT_PROTOCOL 217
+#define IDC_CLIENT_PASSWORD 217
#define IDC_CLIENT_CONFIGURE 218
#define IDC_CLIENT_PROGRAM 219
#define IDC_XDMCP_QUERY 220
@@ -87,7 +87,9 @@
#define IDC_CLIENT_PROGRAM_DESC 228
#define IDC_CLIENT_HOST_DESC 229
#define IDC_CLIENT_USER_DESC 230
-#define IDC_CLIENT_PROTOCOL_DESC 231
+#define IDC_CLIENT_PASSWORD_DESC 231
+#define IDC_CLIENT_REMOTEPROGRAM 232
+#define IDC_CLIENT_REMOTEPROGRAM_DESC 233
#define IDC_FONTPATH_DESC 240
@@ -103,3 +105,5 @@
#define IDC_WGL_DESC 265
#define IDC_CLIPBOARDPRIMARY 266
#define IDC_CLIPBOARDPRIMARY_DESC 267
+#define IDC_DISABLEAC 268
+#define IDC_DISABLEAC_DESC 269
diff --git a/xorg-server/hw/xwin/xlaunch/resources/strings.rc b/xorg-server/hw/xwin/xlaunch/resources/strings.rc
index 10a00d967..1d7fd3b0a 100644
--- a/xorg-server/hw/xwin/xlaunch/resources/strings.rc
+++ b/xorg-server/hw/xwin/xlaunch/resources/strings.rc
@@ -40,13 +40,15 @@
#define STR_XDMCP_DESC "This will start a remote XDMCP session. Starting local clients later is limited. This option is not available with the ""Multiple windows"" mode."
#define STR_CAPTION_PROGRAM "Start program"
-#define STR_CLIENT_PROGRAM_DESC "Start program"
+#define STR_CLIENT_PROGRAM_DESC "Local program"
#define STR_CLIENT_LOCAL "Start program on this computer"
#define STR_CLIENT_REMOTE "Start program on remote computer"
-#define STR_CLIENT_PROTOCOL_DESC "Connect using"
+#define STR_CLIENT_PASSWORD_DESC "Password"
#define STR_CLIENT_HOST_DESC "Connect to computer"
#define STR_CLIENT_USER_DESC "Login as user"
+#define STR_CLIENT_REMOTEPROGRAM_DESC "Remote program"
+
#define STR_CAPTION_XDMCP "XDMCP settings"
#define STR_XDMCP_QUERY "Connect to host"
@@ -66,6 +68,9 @@
#define STR_WGL_DESC "Use the native windows opengl library (wgl). Make sure to export the LIBGL_ALWAYS_INDIRECT environment variable."
#define STR_EXTRA_PARAMS_DESC "Additional parameters for VcXsrv"
+#define STR_DISABLEAC "Disable access control"
+#define STR_DISABLEAC_DESC "Use this when you want vcxsrv to accept connections from all clients."
+
#define STR_CAPTION_FINISH "Finish configuration"
#define STR_FINISH_DESC "Configuration is complete. Click Finish to start VcXsrv."
#define STR_FINISH_SAVE_DESC "You may also save the configuration for later use."