Merge pull request #10791 from akallabeth/vmconnect

[client,common] tighten /vmconnect checks
This commit is contained in:
akallabeth 2024-10-28 10:04:54 +01:00 committed by GitHub
commit e9b942f612
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2604,7 +2604,12 @@ static int parse_vmconnect_options(rdpSettings* settings, const COMMAND_LINE_ARG
if (!freerdp_settings_set_bool(settings, FreeRDP_VmConnectMode, TRUE))
return COMMAND_LINE_ERROR;
if (!freerdp_settings_set_uint32(settings, FreeRDP_ServerPort, 2179))
UINT32 port = freerdp_settings_get_uint32(settings, FreeRDP_ServerPort);
if (port == 3389)
port = 2179;
if (!freerdp_settings_set_uint32(settings, FreeRDP_ServerPort, port))
return COMMAND_LINE_ERROR;
if (!freerdp_settings_set_bool(settings, FreeRDP_NegotiateSecurityLayer, FALSE))
return COMMAND_LINE_ERROR;
@ -5466,6 +5471,16 @@ static int freerdp_client_settings_parse_command_line_arguments_int(
return fail_at(arg, COMMAND_LINE_ERROR);
}
if (freerdp_settings_get_bool(settings, FreeRDP_VmConnectMode))
{
const COMMAND_LINE_ARGUMENT_A* nego = CommandLineFindArgumentA(largs, "nego");
if (nego)
return fail_at(arg, COMMAND_LINE_ERROR);
const UINT32 port = freerdp_settings_get_uint32(settings, FreeRDP_ServerPort);
WLog_INFO(TAG, "/vmconnect uses custom port %" PRIu32, port);
}
fill_credential_strings(largs);
return status;