From 62394bfa7ef8ed061efb5e0a2115a7d7c548429c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 17 Jun 2019 13:31:42 +0200 Subject: [run-virt] openslx.exe: Always pass username on command line Closes #3555 --- .../data/opt/openslx/vmchooser/data/openslx.exe | Bin 58368 -> 58368 bytes core/modules/run-virt/winres/src/winres.c | 12 +++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe b/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe index 54cedabb..e5c11022 100755 Binary files a/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe and b/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe differ diff --git a/core/modules/run-virt/winres/src/winres.c b/core/modules/run-virt/winres/src/winres.c index a9e6024a..fe93d45d 100644 --- a/core/modules/run-virt/winres/src/winres.c +++ b/core/modules/run-virt/winres/src/winres.c @@ -227,7 +227,7 @@ static void CALLBACK launchRunscript(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWO { static int fails = 0; wchar_t params[BUFLEN] = L""; - wchar_t emptyParams[1] = L""; + wchar_t emptyParams[BUFLEN] = L""; wchar_t nuser[BUFLEN] = L""; wchar_t npass[BUFLEN] = L""; @@ -247,14 +247,20 @@ static void CALLBACK launchRunscript(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWO alog("Could not convert user/password to unicode"); goto failure; } - wchar_t *end = params + BUFLEN; + // Build command line with user password + wchar_t *end = params + BUFLEN - 2; wchar_t *ptr = params; ptr = escapeShellArg(nuser, ptr, end); *ptr++ = ' '; ptr = escapeShellArg(npass, ptr, end); *ptr = '\0'; + // Build command line without password, just user + end = emptyParams + BUFLEN - 2; + ptr = emptyParams; + escapeShellArg(nuser, ptr, end); + *ptr = '\0'; if (_debug) { - wlog(L"Params are '%s'", params); + wlog(L"Params are '%s'", emptyParams); } // Scan folder -- cgit v1.2.3-55-g7522