--- sourceforge.net/trunk/rdesktop/rdesktop.c 2003/06/19 07:29:53 424 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2003/07/28 21:41:12 437 @@ -41,7 +41,7 @@ #endif char title[32] = ""; -char username[16]; +char g_username[16]; char hostname[16]; char keymapname[16]; int keylayout = 0x409; /* Defaults to US keyboard layout */ @@ -51,10 +51,11 @@ int tcp_port_rdp = TCP_PORT_RDP; int server_bpp = 8; int win_button_size = 0; /* If zero, disable single app mode */ -BOOL bitmap_compression = True; +BOOL g_bitmap_compression = True; BOOL sendmotion = True; -BOOL orders = True; -BOOL encryption = True; +BOOL g_orders = True; +BOOL g_encryption = True; +BOOL packet_encryption = True; BOOL desktop_save = True; BOOL fullscreen = False; BOOL grab_keyboard = True; @@ -94,6 +95,7 @@ fprintf(stderr, " -f: full-screen mode\n"); fprintf(stderr, " -b: force bitmap updates\n"); fprintf(stderr, " -e: disable encryption (French TS)\n"); + fprintf(stderr, " -E: disable encryption of everything but the logon packet\n"); fprintf(stderr, " -m: do not send motion events\n"); fprintf(stderr, " -C: use private colour map\n"); fprintf(stderr, " -K: keep window manager key bindings\n"); @@ -167,7 +169,7 @@ #define VNCOPT #endif - while ((c = getopt(argc, argv, VNCOPT "u:d:s:S:c:p:n:k:g:a:fbemCKT:Dh?54")) != -1) + while ((c = getopt(argc, argv, VNCOPT "u:d:s:S:c:p:n:k:g:a:fbeEmCKT:Dh?54")) != -1) { switch (c) { @@ -186,7 +188,7 @@ #endif case 'u': - STRNCPY(username, optarg, sizeof(username)); + STRNCPY(g_username, optarg, sizeof(g_username)); username_option = 1; break; @@ -266,13 +268,15 @@ break; case 'b': - orders = False; + g_orders = False; break; case 'e': - encryption = False; + g_encryption = False; + break; + case 'E': + packet_encryption = False; break; - case 'm': sendmotion = False; break; @@ -337,7 +341,7 @@ return 1; } - STRNCPY(username, pw->pw_name, sizeof(username)); + STRNCPY(g_username, pw->pw_name, sizeof(g_username)); } if (hostname[0] == 0) @@ -372,14 +376,18 @@ if (!ui_init()) return 1; - ipc_init(); // Must be run after ui_init, we need X to be setup. - - if (use_rdp5) - cliprdr_init(); // FIXME: Should perhaps be integrated into the channel management code? + /* rdpsnd_init(); */ + /* rdpdr_init(); */ if (!rdp_connect(server, flags, domain, password, shell, directory)) return 1; + /* By setting encryption to False here, we have an encrypted login + packet but unencrypted transfer of other packets */ + if (!packet_encryption) + g_encryption = False; + + DEBUG(("Connection successful.\n")); memset(password, 0, sizeof(password)); @@ -393,7 +401,7 @@ rdp_disconnect(); ui_deinit(); - if (True == rdp_retval) + if (True == rdp_retval) return 0; else return 2;