From 3e3ed445b4a8545edfbdc4ade183070cbd559d85 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 6 Dec 2022 11:36:20 +0100 Subject: [PATCH] [client,file] add rdgiskdcproxy to settings Adds a new option FreeRDP_KerberosRdgIsKdc to manually set the KDC url to the gateway server url --- client/common/file.c | 15 ++++++++++++--- include/freerdp/settings.h | 4 +++- libfreerdp/common/settings_getters.c | 7 +++++++ libfreerdp/common/settings_str.c | 1 + libfreerdp/core/test/settings_property_lists.h | 1 + 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/client/common/file.c b/client/common/file.c index 45dc74077..da2951e46 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -1058,9 +1058,11 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSett file->UsbDevicesToRedirect = redirectUsb; #endif - file->RedirectClipboard = freerdp_settings_get_bool(settings, FreeRDP_RedirectClipboard); - file->RedirectPrinters = freerdp_settings_get_bool(settings, FreeRDP_RedirectPrinters); - file->RedirectDrives = freerdp_settings_get_bool(settings, FreeRDP_RedirectDrives); + file->RedirectClipboard = + freerdp_settings_get_bool(settings, FreeRDP_RedirectClipboard) ? 1 : 0; + file->RedirectPrinters = freerdp_settings_get_bool(settings, FreeRDP_RedirectPrinters) ? 1 : 0; + file->RedirectDrives = freerdp_settings_get_bool(settings, FreeRDP_RedirectDrives) ? 1 : 0; + file->RdgIsKdcProxy = freerdp_settings_get_bool(settings, FreeRDP_KerberosRdgIsProxy) ? 1 : 0; file->RedirectComPorts = (freerdp_settings_get_bool(settings, FreeRDP_RedirectSerialPorts) || freerdp_settings_get_bool(settings, FreeRDP_RedirectParallelPorts)); if (!FILE_POPULATE_STRING(&file->DrivesToRedirect, settings, FreeRDP_DrivesToRedirect) || @@ -2132,6 +2134,13 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* return FALSE; } + if (~((size_t)file->RdgIsKdcProxy)) + { + if (!freerdp_settings_set_bool(settings, FreeRDP_KerberosRdgIsProxy, + file->RdgIsKdcProxy != 0)) + return FALSE; + } + if (file->args->argc > 1) { const char* ConnectionFile = freerdp_settings_get_string(settings, FreeRDP_ConnectionFile); diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 97b64a291..2d2d261de 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -721,6 +721,7 @@ typedef struct #define FreeRDP_KerberosCache (1349) #define FreeRDP_KerberosArmor (1350) #define FreeRDP_KerberosKeytab (1351) +#define FreeRDP_KerberosRdgIsProxy (1352) #define FreeRDP_IgnoreCertificate (1408) #define FreeRDP_CertificateName (1409) #define FreeRDP_CertificateFile (1410) @@ -1249,7 +1250,8 @@ struct rdp_settings ALIGN64 char* KerberosCache; /* 1349 */ ALIGN64 char* KerberosArmor; /* 1350 */ ALIGN64 char* KerberosKeytab; /* 1351 */ - UINT64 padding1408[1408 - 1352]; /* 1352 */ + ALIGN64 BOOL KerberosRdgIsProxy; /* 1352 */ + UINT64 padding1408[1408 - 1353]; /* 1353 */ /* Server Certificate */ ALIGN64 BOOL IgnoreCertificate; /* 1408 */ diff --git a/libfreerdp/common/settings_getters.c b/libfreerdp/common/settings_getters.c index dce91fd61..2172b5263 100644 --- a/libfreerdp/common/settings_getters.c +++ b/libfreerdp/common/settings_getters.c @@ -289,6 +289,9 @@ BOOL freerdp_settings_get_bool(const rdpSettings* settings, size_t id) case FreeRDP_JpegCodec: return settings->JpegCodec; + case FreeRDP_KerberosRdgIsProxy: + return settings->KerberosRdgIsProxy; + case FreeRDP_ListMonitors: return settings->ListMonitors; @@ -918,6 +921,10 @@ BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL val) settings->JpegCodec = cnv.c; break; + case FreeRDP_KerberosRdgIsProxy: + settings->KerberosRdgIsProxy = cnv.c; + break; + case FreeRDP_ListMonitors: settings->ListMonitors = cnv.c; break; diff --git a/libfreerdp/common/settings_str.c b/libfreerdp/common/settings_str.c index 9fe0e215d..814558f8f 100644 --- a/libfreerdp/common/settings_str.c +++ b/libfreerdp/common/settings_str.c @@ -132,6 +132,7 @@ static const struct settings_str_entry settings_map[] = { { FreeRDP_IPv6Enabled, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_IPv6Enabled" }, { FreeRDP_IgnoreCertificate, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_IgnoreCertificate" }, { FreeRDP_JpegCodec, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_JpegCodec" }, + { FreeRDP_KerberosRdgIsProxy, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_KerberosRdgIsProxy" }, { FreeRDP_ListMonitors, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_ListMonitors" }, { FreeRDP_LocalConnection, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_LocalConnection" }, { FreeRDP_LogonErrors, FREERDP_SETTINGS_TYPE_BOOL, "FreeRDP_LogonErrors" }, diff --git a/libfreerdp/core/test/settings_property_lists.h b/libfreerdp/core/test/settings_property_lists.h index 419dabb86..38ff879d3 100644 --- a/libfreerdp/core/test/settings_property_lists.h +++ b/libfreerdp/core/test/settings_property_lists.h @@ -87,6 +87,7 @@ static const size_t bool_list_indices[] = { FreeRDP_IPv6Enabled, FreeRDP_IgnoreCertificate, FreeRDP_JpegCodec, + FreeRDP_KerberosRdgIsProxy, FreeRDP_ListMonitors, FreeRDP_LocalConnection, FreeRDP_LogonErrors,