FreeRDP/FreeRDP — Issue #234: redirect should use FDQN instead of netbios name when possible
Author: mattymo
Created: 2011-11-29 20:52:33+00:00
State: open

In connection.c, you see the following code:

if (redirection->flags & LB_TARGET_NET_ADDRESS) {
xfree(settings->hostname);
settings->hostname = redirection->targetNetAddress.ascii;
} else if (redirection->flags & LB_TARGET_NETBIOS_NAME) {
xfree(settings->hostname);
settings->hostname = redirection->targetNetBiosName.ascii;
}

If the redirecting server provides a FQDN and netbios name, but no IP address, the netbios name is attempted. If the search path isn't present on the client, the redirect fails because of DNS resolution failure.

Below is a patch which could potentially fix this:

diff --git a/libfreerdp-core/connection.c b/libfreerdp-core/connection.c
index 18cc8c1..f36b2e4 100644
--- a/libfreerdp-core/connection.c
+++ b/libfreerdp-core/connection.c
@@ -135,6 +135,9 @@ boolean rdp_client_redirect(rdpRdp* rdp)
if (redirection->flags & LB_TARGET_NET_ADDRESS) {
xfree(settings->hostname);
settings->hostname = redirection->targetNetAddress.ascii;
+ } else if (redirection->flags & LB_TARGET_FQDN) {
+ xfree(settings->hostname);
+ settings->hostname = redirection->targetFQDN.ascii;
} else if (redirection->flags & LB_TARGET_NETBIOS_NAME) {
xfree(settings->hostname);
settings->hostname = redirection->targetNetBiosName.ascii;