Skip to content

Commit 36a31b3

Browse files
committed
security fix
1 parent cf9993b commit 36a31b3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: winvnc/winvnc/vncproperties.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "vncConnDialog.h"
4444

4545
#include "Localization.h" // ACT : Add localization on messages
46+
#include "shlwapi.h"
4647

4748
//extern HINSTANCE g_hInst;
4849

@@ -719,7 +720,7 @@ vncProperties::DialogProc(HWND hwnd,
719720

720721
// Modif sf@2002
721722
SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_SETCHECK, _this->m_server->IsDSMPluginEnabled(), 0);
722-
EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON), _this->m_server->IsDSMPluginEnabled());
723+
EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON), (_this->m_server->AuthClientCount() == 0 ? _this->m_server->IsDSMPluginEnabled(): false));
723724

724725
// Query window option - Taken from TightVNC advanced properties
725726
BOOL queryEnabled = (_this->m_server->QuerySetting() == 4);
@@ -1285,8 +1286,9 @@ vncProperties::DialogProc(HWND hwnd,
12851286
// sf@2002 - DSM Plugin
12861287
case IDC_PLUGIN_CHECK:
12871288
{
1288-
EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON),
1289-
SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_GETCHECK, 0, 0) == BST_CHECKED);
1289+
EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON), _this->m_server->AuthClientCount() == 0
1290+
? SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_GETCHECK, 0, 0) == BST_CHECKED
1291+
: BST_UNCHECKED);
12901292
}
12911293
return TRUE;
12921294
// Marscha@2004 - authSSP: moved MSLogon checkbox back to admin props page
@@ -1368,6 +1370,8 @@ vncProperties::DialogProc(HWND hwnd,
13681370
{
13691371
TCHAR szPlugin[MAX_PATH];
13701372
GetDlgItemText(hwnd, IDC_PLUGINS_COMBO, szPlugin, MAX_PATH);
1373+
PathStripPathA(szPlugin);
1374+
13711375
if (!_this->m_server->GetDSMPluginPointer()->IsLoaded())
13721376
_this->m_server->GetDSMPluginPointer()->LoadPlugin(szPlugin, false);
13731377
else

0 commit comments

Comments
 (0)