Re: Testers for load balancing code wanted
Daniel Drown <[email protected]>
| Newsgroups | gmane.network.rdesktop.devel |
|---|---|
| Message-ID | <[email protected]> |
> What I don't know is what impact this patch has on other users of this code. > Is process_redirect_pdu's current format used by older versions of windows? > Or some other rdp load balancer? Can the client detect what format to use > based on a protocol flag? A command-line flag? Ok, I looked up the protocol specs online, and found the relevant document: http://msdn.microsoft.com/en-us/library/ee443575(PROT.10).aspx [MS-RDPBCGR] section 2.2.13.1 The RedirFlags (g_redirect_flags in the rdesktop code) specify which strings are present in the message. Attached is a patch (against 1.6.0) to support these flags. With this, I no longer have problems with the rdesktop client crashing on login. The patch does not apply cleanly to trunk, but the conflict is minor (g_redirect_username switched from static buffer to run-time allocation). If anyone needs a patch against trunk, I can send it to them. I beleive this will fix rdesktop-Bugs-2845414: https://sourceforge.net/tracker/index.php?func=detail&aid=2845414&group_id=24366&atid=381347 ------------------------------------------------------------------------------ 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.patch
(text/plain, 4.6 KB)
Index: rdp.c
===================================================================
--- rdp.c (revision 1555)
+++ rdp.c (working copy)
@@ -1340,49 +1340,83 @@
/* 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 */
- rdp_in_unistr(s, g_redirect_username, sizeof(g_redirect_username), len);
+ /* read username string */
+ rdp_in_unistr(s, g_redirect_username, sizeof(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 1555)
+++ constants.h (working copy)
@@ -436,3 +436,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
+};