fix freerdp_client_settings_post_processing
This commit is contained in:
parent
6812383d05
commit
f06490b426
@ -102,6 +102,38 @@ HANDLE freerdp_client_get_thread(rdpContext* context)
|
||||
return ((rdpClientContext*) context)->thread;
|
||||
}
|
||||
|
||||
static BOOL freerdp_client_settings_post_process(rdpSettings* settings)
|
||||
{
|
||||
/* Moved GatewayUseSameCredentials logic outside of cmdline.c, so
|
||||
* that the rdp file also triggers this functionality */
|
||||
if (settings->GatewayEnabled)
|
||||
{
|
||||
if (settings->GatewayUseSameCredentials)
|
||||
{
|
||||
if (settings->Username)
|
||||
{
|
||||
settings->GatewayUsername = _strdup(settings->Username);
|
||||
if (!settings->GatewayUsername)
|
||||
return FALSE;
|
||||
}
|
||||
if (settings->Domain)
|
||||
{
|
||||
settings->GatewayDomain = _strdup(settings->Domain);
|
||||
if (!settings->GatewayDomain)
|
||||
return FALSE;
|
||||
}
|
||||
if (settings->Password)
|
||||
{
|
||||
settings->GatewayPassword = _strdup(settings->Password);
|
||||
if (!settings->GatewayPassword)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, char** argv)
|
||||
{
|
||||
int status;
|
||||
@ -124,35 +156,18 @@ int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc,
|
||||
status = freerdp_client_settings_parse_assistance_file(settings, settings->AssistanceFile);
|
||||
}
|
||||
|
||||
/* Only call post processing if no status/error was returned*/
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
/* This function will call logic that is applicable to the settings
|
||||
* from command line parsing AND the rdp file parsing */
|
||||
status = freerdp_client_combined_logic(settings);
|
||||
if(!freerdp_client_settings_post_process(settings))
|
||||
return -1;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int freerdp_client_combined_logic(rdpSettings* settings)
|
||||
{
|
||||
/* Moved GatewayUseSameCredentials logic outside of cmdline.c, so
|
||||
* that the rdp file also triggers this functionality */
|
||||
if (settings->GatewayEnabled)
|
||||
{
|
||||
if (settings->GatewayUseSameCredentials)
|
||||
{
|
||||
if (settings->Username)
|
||||
settings->GatewayUsername = _strdup(settings->Username);
|
||||
|
||||
if (settings->Domain)
|
||||
settings->GatewayDomain = _strdup(settings->Domain);
|
||||
|
||||
if (settings->Password)
|
||||
settings->GatewayPassword = _strdup(settings->Password);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int freerdp_client_settings_parse_connection_file(rdpSettings* settings, const char* filename)
|
||||
{
|
||||
rdpFile* file;
|
||||
|
Loading…
Reference in New Issue
Block a user