[aad] Respect the /server-name command line option (again)

AAD authentication fails when you give a bare IP to /v.

This was previously merged in PR #11004 but then accidentally reverted
in PR #11006.
This commit is contained in:
James Le Cuirot
2024-12-19 12:18:53 +00:00
parent cd8ab9817f
commit 51849fcb0a

View File

@@ -272,17 +272,17 @@ int aad_client_begin(rdpAad* aad)
/* Get the host part of the hostname */
const char* hostname = freerdp_settings_get_string(settings, FreeRDP_AadServerHostname);
if (!hostname)
hostname = freerdp_settings_get_string(settings, FreeRDP_ServerHostname);
hostname = freerdp_settings_get_server_name(settings);
if (!hostname)
{
WLog_Print(aad->log, WLOG_ERROR, "FreeRDP_ServerHostname == NULL");
WLog_Print(aad->log, WLOG_ERROR, "hostname == NULL");
return -1;
}
aad->hostname = _strdup(hostname);
if (!aad->hostname)
{
WLog_Print(aad->log, WLOG_ERROR, "_strdup(FreeRDP_ServerHostname) == NULL");
WLog_Print(aad->log, WLOG_ERROR, "_strdup(hostname) == NULL");
return -1;
}