Re: Testers for load balancing code wanted

Daniel Drown <[email protected]>
Newsgroups gmane.network.rdesktop.devel
Message-ID <[email protected]>
On Wed, 20 Jan 2010, Peter Åstrand wrote:
> If you prepare a patch against trunk, I'd like to commit this patch.

Ok, attached.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev

_______________________________________________
rdesktop-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdesktop-devel
rdp-redirect-trunk.patch (text/plain, 4.7 KB)
Index: rdp.c
===================================================================
--- rdp.c	(revision 1556)
+++ rdp.c	(working copy)
@@ -1481,50 +1481,84 @@
 	/* read connection flags */
 	in_uint32_le(s, g_redirect_flags);
 
-	/* read length of ip string */
-	in_uint32_le(s, len);
+        if(g_redirect_flags & PDU_REDIRECT_HAS_IP) {
+          /* read length of ip string */
+          in_uint32_le(s, len);
 
-	/* read ip string */
-	rdp_in_unistr(s, g_redirect_server, sizeof(g_redirect_server), len);
+          /* read ip string */
+          rdp_in_unistr(s, g_redirect_server, sizeof(g_redirect_server), len);
+        }
 
-	/* read length of cookie string */
-	in_uint32_le(s, len);
+        if(g_redirect_flags & PDU_REDIRECT_HAS_COOKIE) {
+          /* read length of cookie string */
+          in_uint32_le(s, len);
 
-	/* read cookie string (plain ASCII) */
-	if (len > sizeof(g_redirect_cookie) - 1)
-	{
-		uint32 rem = len - (sizeof(g_redirect_cookie) - 1);
-		len = sizeof(g_redirect_cookie) - 1;
+          /* read cookie string (plain ASCII) */
+          if (len > sizeof(g_redirect_cookie) - 1)
+          {
+            uint32 rem = len - (sizeof(g_redirect_cookie) - 1);
+            len = sizeof(g_redirect_cookie) - 1;
 
-		warning("Unexpectedly large redirection cookie\n");
-		in_uint8a(s, g_redirect_cookie, len);
-		in_uint8s(s, rem);
-	}
-	else
-	{
-		in_uint8a(s, g_redirect_cookie, len);
-	}
-	g_redirect_cookie[len] = 0;
+            warning("Unexpectedly large redirection cookie\n");
+            in_uint8a(s, g_redirect_cookie, len);
+            in_uint8s(s, rem);
+          }
+          else
+          {
+            in_uint8a(s, g_redirect_cookie, len);
+          }
+          g_redirect_cookie[len] = 0;
+        }
 
-	/* read length of username string */
-	in_uint32_le(s, len);
+        if(g_redirect_flags & PDU_REDIRECT_HAS_USERNAME) {
+          /* read length of username string */
+          in_uint32_le(s, len);
 
-	/* read username string */
-	g_redirect_username = (char *) xmalloc(len + 1);
-	rdp_in_unistr(s, g_redirect_username, strlen(g_redirect_username), len);
+          /* read username string */
+          g_redirect_username = (char *) xmalloc(len + 1);
+          rdp_in_unistr(s, g_redirect_username, strlen(g_redirect_username), len);
+        }
 
-	/* read length of domain string */
-	in_uint32_le(s, len);
+        if(g_redirect_flags & PDU_REDIRECT_HAS_DOMAIN) {
+          /* read length of domain string */
+          in_uint32_le(s, len);
 
-	/* read domain string */
-	rdp_in_unistr(s, g_redirect_domain, sizeof(g_redirect_domain), len);
+          /* read domain string */
+          rdp_in_unistr(s, g_redirect_domain, sizeof(g_redirect_domain), len);
+        }
 
-	/* read length of password string */
-	in_uint32_le(s, len);
+        if(g_redirect_flags & PDU_REDIRECT_HAS_PASSWORD) {
+          /* read length of password string */
+          in_uint32_le(s, len);
 
-	/* read password string */
-	rdp_in_unistr(s, g_redirect_password, sizeof(g_redirect_password), len);
+          /* read password string */
+          rdp_in_unistr(s, g_redirect_password, sizeof(g_redirect_password), len);
+        }
 
+        if(g_redirect_flags & PDU_REDIRECT_DONT_STORE_USERNAME) {
+          warning("PDU_REDIRECT_DONT_STORE_USERNAME set\n");
+        }
+
+        if(g_redirect_flags & PDU_REDIRECT_USE_SMARTCARD) {
+          warning("PDU_REDIRECT_USE_SMARTCARD set\n");
+        }
+
+        if(g_redirect_flags & PDU_REDIRECT_INFORMATIONAL) {
+          warning("PDU_REDIRECT_INFORMATIONAL set\n");
+        }
+
+        if(g_redirect_flags & PDU_REDIRECT_HAS_TARGET_FQDN) {
+          warning("PDU_REDIRECT_HAS_TARGET_FQDN set\n");
+        }
+
+        if(g_redirect_flags & PDU_REDIRECT_HAS_TARGET_NETBIOS) {
+          warning("PDU_REDIRECT_HAS_TARGET_NETBIOS set\n");
+        }
+
+        if(g_redirect_flags & PDU_REDIRECT_HAS_TARGET_IP_ARRAY) {
+          warning("PDU_REDIRECT_HAS_TARGET_IP_ARRAY set\n");
+        }
+
 	g_redirect = True;
 
 	return True;
Index: constants.h
===================================================================
--- constants.h	(revision 1556)
+++ constants.h	(working copy)
@@ -455,3 +455,19 @@
 #define SCARD_LOCK_CHANNEL	2
 #define SCARD_LOCK_RDPDR	3
 #define SCARD_LOCK_LAST		4
+
+
+/* redirect flags, from [MS-RDPBCGR] 2.2.13.1 */
+enum RDP_PDU_REDIRECT_FLAGS {
+  PDU_REDIRECT_HAS_IP = 0x1,
+  PDU_REDIRECT_HAS_COOKIE = 0x2,
+  PDU_REDIRECT_HAS_USERNAME = 0x4,
+  PDU_REDIRECT_HAS_DOMAIN = 0x8,
+  PDU_REDIRECT_HAS_PASSWORD = 0x10,
+  PDU_REDIRECT_DONT_STORE_USERNAME = 0x20,
+  PDU_REDIRECT_USE_SMARTCARD = 0x40,
+  PDU_REDIRECT_INFORMATIONAL = 0x80,
+  PDU_REDIRECT_HAS_TARGET_FQDN = 0x100,
+  PDU_REDIRECT_HAS_TARGET_NETBIOS = 0x200,
+  PDU_REDIRECT_HAS_TARGET_IP_ARRAY = 0x800
+};
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.