Hello community, here is the log from the commit of package rdesktop for openSUSE:Factory checked in at 2014-12-30 00:50:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rdesktop (Old) and /work/SRC/openSUSE:Factory/.rdesktop.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rdesktop" Changes: -------- --- /work/SRC/openSUSE:Factory/rdesktop/rdesktop.changes 2014-10-06 22:05:04.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rdesktop.new/rdesktop.changes 2014-12-30 00:51:00.000000000 +0100 @@ -1,0 +2,23 @@ +Mon Dec 29 15:02:59 UTC 2014 - [email protected] + +- fix for boo#897205 (rdesktop to Windows 2008 R2 Terminal Server) +- update to 1.8.3 + * Added a persistent mode used with SeamlessRDP + * Added US international keyboard layout with dead keys + * Code cleanup to match specifications, use constants defined + instead of magic numbers, remove of dead code + * Fix regression with failed connection and a invalid licensing + message, introduced in 1.8.2 + * Fix issue with Non ASCII user / password when using CredSSP + * Fix issues using smartcard redirection with Windows 2012 R2 + * Fix issue with windows key functionality + * Fix memory corruption when using rdp_out_unistr() + * Fix workaround for the lack of support for alpha cursors + * Fix silent exit when redirected when using CredSSP + * Fix crash when starting rdesktop without domain specified while + using CredSSP + * Fix issue in SeamlessRDP protocol parser upon reconnect + * Fix issue were a new SeamlessRDP application is respawned upon + a reconnection + +------------------------------------------------------------------- Old: ---- rdesktop-1.8.2.tar.gz New: ---- rdesktop-1.8.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rdesktop.spec ++++++ --- /var/tmp/diff_new_pack.wf7GR3/_old 2014-12-30 00:51:02.000000000 +0100 +++ /var/tmp/diff_new_pack.wf7GR3/_new 2014-12-30 00:51:02.000000000 +0100 @@ -21,7 +21,7 @@ License: GPL-3.0+ Group: Productivity/Networking/Other #Group: Productivity/Networking/Remote Desktop -Version: 1.8.2 +Version: 1.8.3 Release: 0 Url: http://www.rdesktop.org/ Source: %{name}-%{version}.tar.gz ++++++ rdesktop-1.8.2.tar.gz -> rdesktop-1.8.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/configure new/rdesktop-1.8.3/configure --- old/rdesktop-1.8.2/configure 2014-05-20 16:35:19.000000000 +0200 +++ new/rdesktop-1.8.3/configure 2014-10-31 12:40:13.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for rdesktop 1.8.2. +# Generated by GNU Autoconf 2.69 for rdesktop 1.8.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ # Identity of this package. PACKAGE_NAME='rdesktop' PACKAGE_TARNAME='rdesktop' -PACKAGE_VERSION='1.8.2' -PACKAGE_STRING='rdesktop 1.8.2' +PACKAGE_VERSION='1.8.3' +PACKAGE_STRING='rdesktop 1.8.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1302,7 +1302,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rdesktop 1.8.2 to adapt to many kinds of systems. +\`configure' configures rdesktop 1.8.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1371,7 +1371,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rdesktop 1.8.2:";; + short | recursive ) echo "Configuration of rdesktop 1.8.3:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rdesktop configure 1.8.2 +rdesktop configure 1.8.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2031,7 +2031,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rdesktop $as_me 1.8.2, which was +It was created by rdesktop $as_me 1.8.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8030,7 +8030,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rdesktop $as_me 1.8.2, which was +This file was extended by rdesktop $as_me 1.8.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8083,7 +8083,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rdesktop config.status 1.8.2 +rdesktop config.status 1.8.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/configure.ac new/rdesktop-1.8.3/configure.ac --- old/rdesktop-1.8.2/configure.ac 2014-05-20 16:30:56.000000000 +0200 +++ new/rdesktop-1.8.3/configure.ac 2014-10-31 12:39:04.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT(rdesktop, 1.8.2) +AC_INIT(rdesktop, 1.8.3) AC_CONFIG_SRCDIR([rdesktop.c]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/constants.h new/rdesktop-1.8.3/constants.h --- old/rdesktop-1.8.2/constants.h 2014-05-20 16:29:22.000000000 +0200 +++ new/rdesktop-1.8.3/constants.h 2014-09-09 14:34:09.000000000 +0200 @@ -318,13 +318,16 @@ #define RDP_SOURCE "MSTSC" /* Logon flags */ -#define RDP_LOGON_AUTO 0x0008 -#define RDP_LOGON_NORMAL 0x0033 -#define RDP_LOGON_COMPRESSION 0x0080 /* mppc compression with 8kB histroy buffer */ -#define RDP_LOGON_BLOB 0x0100 -#define RDP_LOGON_COMPRESSION2 0x0200 /* rdp5 mppc compression with 64kB history buffer */ -#define RDP_LOGON_LEAVE_AUDIO 0x2000 -#define RDP_LOGON_PASSWORD_IS_SC_PIN 0x40000 +#define RDP_INFO_MOUSE 0x00000001 +#define RDP_INFO_DISABLECTRLALTDEL 0x00000002 +#define RDP_INFO_AUTOLOGON 0x00000008 +#define RDP_INFO_UNICODE 0x00000010 +#define RDP_INFO_MAXIMIZESHELL 0x00000020 +#define RDP_INFO_COMPRESSION 0x00000080 /* mppc compression with 8kB histroy buffer */ +#define RDP_INFO_ENABLEWINDOWSKEY 0x00000100 +#define RDP_INFO_COMPRESSION2 0x00000200 /* rdp5 mppc compression with 64kB history buffer */ +#define RDP_INFO_REMOTE_CONSOLE_AUDIO 0x00002000 +#define RDP_INFO_PASSWORD_IS_SC_PIN 0x00040000 #define RDP5_DISABLE_NOTHING 0x00 #define RDP5_NO_WALLPAPER 0x01 @@ -447,6 +450,24 @@ #define TSSNDCAPS_VOLUME 0x00000002 /* RDPDR constants */ + +#define RDPDR_CTYP_CORE 0x4472 +#define RDPDR_CTYP_PRN 0x5052 + +#define PAKID_CORE_SERVER_ANNOUNCE 0x496e +#define PAKID_CORE_CLIENTID_CONFIRM 0x4343 +#define PAKID_CORE_CLIENT_NAME 0x434e +#define PAKID_CORE_DEVICE_LIST_ANNOUNCE 0x4441 +#define PAKID_CORE_DEVICE_REPLY 0x6472 +#define PAKID_CORE_DEVICE_IOREQUEST 0x4952 +#define PAKID_CORE_DEVICE_IOCOMPLETION 0x4943 +#define PAKID_CORE_SERVER_CAPABILITY 0x5350 +#define PAKID_CORE_CLIENT_CAPABILITY 0x4350 +#define PAKID_CORE_DEVICELIST_REMOVE 0x444d +#define PAKID_PRN_CACHE_DATA 0x5043 +#define PAKID_CORE_USER_LOGGEDON 0x554c +#define PAKID_PRN_USING_XPS 0x5543 + #define RDPDR_MAX_DEVICES 0x10 #define DEVICE_TYPE_SERIAL 0x01 #define DEVICE_TYPE_PARALLEL 0x02 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/cssp.c new/rdesktop-1.8.3/cssp.c --- old/rdesktop-1.8.2/cssp.c 2014-05-20 16:29:23.000000000 +0200 +++ new/rdesktop-1.8.3/cssp.c 2014-08-29 12:57:24.000000000 +0200 @@ -262,7 +262,7 @@ memset(&message, 0, sizeof(message)); // domainName [0] - s_realloc(&tmp, strlen(domain) * sizeof(uint16)); + s_realloc(&tmp, 4 + strlen(domain) * sizeof(uint16)); s_reset(&tmp); rdp_out_unistr(&tmp, domain, strlen(domain) * sizeof(uint16)); s_mark_end(&tmp); @@ -275,7 +275,7 @@ s_free(h1); // userName [1] - s_realloc(&tmp, strlen(username) * sizeof(uint16)); + s_realloc(&tmp, 4 + strlen(username) * sizeof(uint16)); s_reset(&tmp); rdp_out_unistr(&tmp, username, strlen(username) * sizeof(uint16)); s_mark_end(&tmp); @@ -289,7 +289,7 @@ s_free(h1); // password [2] - s_realloc(&tmp, strlen(password) * sizeof(uint16)); + s_realloc(&tmp, 4 + strlen(password) * sizeof(uint16)); s_reset(&tmp); rdp_out_unistr(&tmp, password, strlen(password) * sizeof(uint16)); s_mark_end(&tmp); @@ -339,7 +339,7 @@ // cardName [1] if (card) { - s_realloc(&tmp, strlen(card) * sizeof(uint16)); + s_realloc(&tmp, 4 + strlen(card) * sizeof(uint16)); s_reset(&tmp); rdp_out_unistr(&tmp, card, strlen(card) * sizeof(uint16)); s_mark_end(&tmp); @@ -355,7 +355,7 @@ // readerName [2] if (reader) { - s_realloc(&tmp, strlen(reader) * sizeof(uint16)); + s_realloc(&tmp, 4 + strlen(reader) * sizeof(uint16)); s_reset(&tmp); rdp_out_unistr(&tmp, reader, strlen(reader) * sizeof(uint16)); s_mark_end(&tmp); @@ -371,7 +371,7 @@ // containerName [3] if (container) { - s_realloc(&tmp, strlen(container) * sizeof(uint16)); + s_realloc(&tmp, 4 + strlen(container) * sizeof(uint16)); s_reset(&tmp); rdp_out_unistr(&tmp, container, strlen(container) * sizeof(uint16)); s_mark_end(&tmp); @@ -387,7 +387,7 @@ // cspName [4] if (csp) { - s_realloc(&tmp, strlen(csp) * sizeof(uint16)); + s_realloc(&tmp, 4 + strlen(csp) * sizeof(uint16)); s_reset(&tmp); rdp_out_unistr(&tmp, csp, strlen(csp) * sizeof(uint16)); s_mark_end(&tmp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/doc/ChangeLog new/rdesktop-1.8.3/doc/ChangeLog --- old/rdesktop-1.8.2/doc/ChangeLog 2014-05-20 16:30:56.000000000 +0200 +++ new/rdesktop-1.8.3/doc/ChangeLog 2014-10-31 12:39:04.000000000 +0100 @@ -1,3 +1,24 @@ +rdesktop (1.8.3) + * Added a persistent mode used with SeamlessRDP + * Added US international keyboard layout with dead keys + * Code cleanup to match specifications, use constants defined + instead of magic numbers, remove of dead code + * Fix regression with failed connection and a invalid licensing + message, introduced in 1.8.2 + * Fix issue with Non ASCII user / password when using CredSSP + * Fix issues using smartcard redirection with Windows 2012 R2 + * Fix issue with windows key functionality + * Fix memory corruption when using rdp_out_unistr() + * Fix workaround for the lack of support for alpha cursors + * Fix silent exit when redirected when using CredSSP + * Fix crash when starting rdesktop without domain specified + while using CredSSP + * Fix issue in SeamlessRDP protocol parser upon reconnect + * Fix issue were a new SeamlessRDP application is respawned + upon a reconnection + + -- Henrik Andersson <[email protected]> 2014-10-31 + rdesktop (1.8.2) * Support enhanced server redirection (Session broker 2012) * Support License Error Alert PDU diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/proto.h new/rdesktop-1.8.3/proto.h --- old/rdesktop-1.8.2/proto.h 2014-05-20 16:29:22.000000000 +0200 +++ new/rdesktop-1.8.3/proto.h 2014-09-11 13:54:46.000000000 +0200 @@ -336,6 +336,7 @@ RD_BOOL lspci_init(void); /* seamless.c */ RD_BOOL seamless_init(void); +void seamless_reset_state(void); unsigned int seamless_send_sync(void); unsigned int seamless_send_state(unsigned long id, unsigned int state, unsigned long flags); unsigned int seamless_send_position(unsigned long id, int x, int y, int width, int height, @@ -345,12 +346,13 @@ unsigned int seamless_send_focus(unsigned long id, unsigned long flags); unsigned int seamless_send_destroy(unsigned long id); unsigned int seamless_send_spawn(char *cmd); +unsigned int seamless_send_persistent(RD_BOOL); /* scard.c */ void scard_lock(int lock); void scard_unlock(int lock); int scard_enum_devices(uint32 * id, char *optarg); -void scardSetInfo(uint32 device, uint32 id, uint32 bytes_out); +void scardSetInfo(uint32 epoch, uint32 device, uint32 id, uint32 bytes_out); void scard_reset_state(); /* *INDENT-OFF* */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/rdesktop.c new/rdesktop-1.8.3/rdesktop.c --- old/rdesktop-1.8.2/rdesktop.c 2014-05-20 16:29:23.000000000 +0200 +++ new/rdesktop-1.8.3/rdesktop.c 2014-09-11 13:54:46.000000000 +0200 @@ -109,6 +109,7 @@ RD_BOOL g_use_password_as_pin = False; char g_seamless_shell[512]; char g_seamless_spawn_cmd[512]; +RD_BOOL g_seamless_persistent_mode = True; RD_BOOL g_user_quit = False; uint32 g_embed_wnd; uint32 g_rdp5_performanceflags = @@ -554,7 +555,10 @@ act.sa_flags = 0; sigaction(SIGPIPE, &act, NULL); - flags = RDP_LOGON_NORMAL; + /* setup default flags for TS_INFO_PACKET */ + flags = RDP_INFO_MOUSE | RDP_INFO_DISABLECTRLALTDEL + | RDP_INFO_UNICODE | RDP_INFO_MAXIMIZESHELL | RDP_INFO_ENABLEWINDOWSKEY; + prompt_password = False; g_seamless_spawn_cmd[0] = domain[0] = g_password[0] = shell[0] = directory[0] = 0; g_embed_wnd = 0; @@ -610,6 +614,7 @@ case 's': STRNCPY(shell, optarg, sizeof(shell)); + g_seamless_persistent_mode = False; break; case 'c': @@ -624,7 +629,7 @@ } STRNCPY(g_password, optarg, sizeof(g_password)); - flags |= RDP_LOGON_AUTO; + flags |= RDP_INFO_AUTOLOGON; /* try to overwrite argument so it won't appear in ps */ p = optarg; @@ -633,7 +638,7 @@ break; #ifdef WITH_SCARD case 'i': - flags |= RDP_LOGON_PASSWORD_IS_SC_PIN; + flags |= RDP_INFO_PASSWORD_IS_SC_PIN; g_use_password_as_pin = True; break; #endif @@ -772,27 +777,30 @@ case 'z': DEBUG(("rdp compression enabled\n")); - flags |= (RDP_LOGON_COMPRESSION | RDP_LOGON_COMPRESSION2); + flags |= (RDP_INFO_COMPRESSION | RDP_INFO_COMPRESSION2); break; case 'x': if (str_startswith(optarg, "m")) /* modem */ { - g_rdp5_performanceflags = + g_rdp5_performanceflags = RDP5_NO_CURSOR_SHADOW | RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | RDP5_NO_MENUANIMATIONS | RDP5_NO_THEMING; } else if (str_startswith(optarg, "b")) /* broadband */ { - g_rdp5_performanceflags = RDP5_NO_WALLPAPER; + g_rdp5_performanceflags = + RDP5_NO_CURSOR_SHADOW | RDP5_NO_WALLPAPER; } else if (str_startswith(optarg, "l")) /* lan */ { - g_rdp5_performanceflags = RDP5_DISABLE_NOTHING; + g_rdp5_performanceflags = + RDP5_NO_CURSOR_SHADOW | RDP5_DISABLE_NOTHING; } else { - g_rdp5_performanceflags = strtol(optarg, NULL, 16); + g_rdp5_performanceflags = + RDP5_NO_CURSOR_SHADOW | strtol(optarg, NULL, 16); } break; @@ -812,7 +820,7 @@ while ((p = next_arg(optarg, ','))) { if (str_startswith(optarg, "remote")) - flags |= RDP_LOGON_LEAVE_AUDIO; + flags |= RDP_INFO_REMOTE_CONSOLE_AUDIO; if (str_startswith(optarg, "local")) #ifdef WITH_RDPSND @@ -1059,7 +1067,7 @@ if (prompt_password && read_password(g_password, sizeof(g_password))) - flags |= RDP_LOGON_AUTO; + flags |= RDP_INFO_AUTOLOGON; if (g_title[0] == 0) { @@ -1118,7 +1126,7 @@ g_username = (char *) xmalloc(strlen(g_redirect_username) + 1); STRNCPY(g_username, g_redirect_username, strlen(g_redirect_username) + 1); STRNCPY(server, g_redirect_server, sizeof(server)); - flags |= RDP_LOGON_AUTO; + flags |= RDP_INFO_AUTOLOGON; fprintf(stderr, "Redirected to %s@%s session %d.\n", g_redirect_username, g_redirect_server, g_redirect_session_id); @@ -1127,6 +1135,7 @@ and therefor we just clear this error before we connect to redirected server. */ g_network_error = False; + g_redirect = False; } ui_init_connection(); @@ -1151,6 +1160,11 @@ continue; } + if (g_redirect) + { + rdp_disconnect(); + continue; + } /* By setting encryption to False here, we have an encrypted login packet but unencrypted transfer of other packets */ @@ -1163,7 +1177,6 @@ tcp_run_ui(True); deactivated = False; - g_redirect = False; g_reconnect_loop = False; rdp_main_loop(&deactivated, &ext_disc_reason); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/rdesktop.spec new/rdesktop-1.8.3/rdesktop.spec --- old/rdesktop-1.8.2/rdesktop.spec 2014-05-20 16:31:14.000000000 +0200 +++ new/rdesktop-1.8.3/rdesktop.spec 2014-10-31 12:39:04.000000000 +0100 @@ -1,6 +1,6 @@ Summary: Remote Desktop Protocol client Name: rdesktop -Version: 1.8.2 +Version: 1.8.3 Release: 1 License: GPL; see COPYING Group: Applications/Communications diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/rdp.c new/rdesktop-1.8.3/rdp.c --- old/rdesktop-1.8.2/rdp.c 2014-05-20 16:29:23.000000000 +0200 +++ new/rdesktop-1.8.3/rdp.c 2014-08-27 14:19:59.000000000 +0200 @@ -189,6 +189,9 @@ void rdp_out_unistr(STREAM s, char *string, int len) { + if (string == NULL || len == 0) + return; + #ifdef HAVE_ICONV size_t ibl = strlen(string), obl = len + 2; static iconv_t iconv_h = (iconv_t) - 1; @@ -1733,14 +1736,26 @@ rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect) { + RD_BOOL deactivated = False; + uint32 ext_disc_reason = 0; + if (!sec_connect(server, g_username, domain, password, reconnect)) return False; rdp_send_logon_info(flags, domain, g_username, password, command, directory); - if (g_network_error) - return False; + /* run RDP loop until first licence demand active PDU */ + while (!g_rdp_shareid) + { + if (g_network_error) + return False; + + if (!rdp_loop(&deactivated, &ext_disc_reason)) + return False; + if (g_redirect) + return True; + } return True; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/rdpdr.c new/rdesktop-1.8.3/rdpdr.c --- old/rdesktop-1.8.2/rdpdr.c 2014-05-20 16:29:23.000000000 +0200 +++ new/rdesktop-1.8.3/rdpdr.c 2014-09-11 13:54:46.000000000 +0200 @@ -2,7 +2,7 @@ rdesktop: A Remote Desktop Protocol client. Copyright (C) Matthew Chapman <matthewc.unsw.edu.au> 1999-2008 Copyright 2004-2011 Peter Astrand <[email protected]> for Cendio AB - Copyright 2010-2013 Henrik Andersson <[email protected]> for Cendio AB + Copyright 2010-2014 Henrik Andersson <[email protected]> for Cendio AB This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -68,11 +68,14 @@ extern RD_BOOL g_notify_stamp; static VCHANNEL *rdpdr_channel; +static uint32 g_epoch; /* If select() times out, the request for the device with handle g_min_timeout_fd is aborted */ RD_NTHANDLE g_min_timeout_fd; uint32 g_num_devices; +uint32 g_client_id; + /* Table with information about rdpdr devices */ RDPDR_DEVICE g_rdpdr_device[RDPDR_MAX_DEVICES]; char *g_rdpdr_clientname = NULL; @@ -186,25 +189,25 @@ } static void -rdpdr_send_connect(void) +rdpdr_send_client_announce_reply(void) { - uint8 magic[4] = "rDCC"; + /* DR_CORE_CLIENT_ANNOUNCE_RSP */ STREAM s; - s = channel_init(rdpdr_channel, 12); - out_uint8a(s, magic, 4); - out_uint16_le(s, 1); /* unknown */ - out_uint16_le(s, 5); - out_uint32_be(s, 0x815ed39d); /* IP address (use 127.0.0.1) 0x815ed39d */ + out_uint16_le(s, RDPDR_CTYP_CORE); + out_uint16_le(s, PAKID_CORE_CLIENTID_CONFIRM); + out_uint16_le(s, 1); /* VersionMajor, MUST be set to 0x1 */ + out_uint16_le(s, 5); /* VersionMinor */ + out_uint32_be(s, g_client_id); /* ClientID */ s_mark_end(s); channel_send(s, rdpdr_channel); } static void -rdpdr_send_name(void) +rdpdr_send_client_name_request(void) { - uint8 magic[4] = "rDNC"; + /* DR_CORE_CLIENT_NAME_REQ */ STREAM s; uint32 hostlen; @@ -215,11 +218,11 @@ hostlen = (strlen(g_rdpdr_clientname) + 1) * 2; s = channel_init(rdpdr_channel, 16 + hostlen); - out_uint8a(s, magic, 4); - out_uint16_le(s, 0x63); /* unknown */ - out_uint16_le(s, 0x72); - out_uint32(s, 0); - out_uint32_le(s, hostlen); + out_uint16_le(s, RDPDR_CTYP_CORE); + out_uint16_le(s, PAKID_CORE_CLIENT_NAME); + out_uint32_le(s, 1); /* UnicodeFlag */ + out_uint32_le(s, 0); /* CodePage */ + out_uint32_le(s, hostlen); /* ComputerNameLen */ rdp_out_unistr(s, g_rdpdr_clientname, hostlen - 2); s_mark_end(s); channel_send(s, rdpdr_channel); @@ -254,17 +257,18 @@ } static void -rdpdr_send_available(void) +rdpdr_send_client_device_list_announce(void) { - - uint8 magic[4] = "rDAD"; + /* DR_CORE_CLIENT_ANNOUNCE_RSP */ uint32 driverlen, printerlen, bloblen; int i; STREAM s; PRINTER *printerinfo; s = channel_init(rdpdr_channel, announcedata_size()); - out_uint8a(s, magic, 4); + out_uint16_le(s, RDPDR_CTYP_CORE); + out_uint16_le(s, PAKID_CORE_DEVICE_LIST_ANNOUNCE); + out_uint32_le(s, g_num_devices); for (i = 0; i < g_num_devices; i++) @@ -301,13 +305,6 @@ out_uint32(s, 0); } } -#if 0 - out_uint32_le(s, 0x20); /* Device type 0x20 - smart card */ - out_uint32_le(s, 0); - out_uint8p(s, "SCARD", 5); - out_uint8s(s, 3); - out_uint32(s, 0); -#endif s_mark_end(s); channel_send(s, rdpdr_channel); @@ -317,14 +314,14 @@ rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer, uint32 length) { - uint8 magic[4] = "rDCI"; STREAM s; #ifdef WITH_SCARD scard_lock(SCARD_LOCK_RDPDR); #endif s = channel_init(rdpdr_channel, 20 + length); - out_uint8a(s, magic, 4); + out_uint16_le(s, RDPDR_CTYP_CORE); + out_uint16_le(s, PAKID_CORE_DEVICE_IOCOMPLETION); out_uint32_le(s, device); out_uint32_le(s, id); out_uint32_le(s, status); @@ -699,7 +696,7 @@ out.size = sizeof(buffer); #ifdef WITH_SCARD - scardSetInfo(device, id, bytes_out + 0x14); + scardSetInfo(g_epoch, device, id, bytes_out + 0x14); #endif status = fns->device_control(file, request, s, &out); result = buffer_len = out.p - out.data; @@ -754,13 +751,13 @@ } static void -rdpdr_send_clientcapability(void) +rdpdr_send_client_capability_response(void) { - uint8 magic[4] = "rDPC"; + /* DR_CORE_CAPABILITY_RSP */ STREAM s; - s = channel_init(rdpdr_channel, 0x50); - out_uint8a(s, magic, 4); + out_uint16_le(s, RDPDR_CTYP_CORE); + out_uint16_le(s, PAKID_CORE_CLIENT_CAPABILITY); out_uint32_le(s, 5); /* count */ out_uint16_le(s, 1); /* first */ out_uint16_le(s, 0x28); /* length */ @@ -797,58 +794,70 @@ rdpdr_process(STREAM s) { uint32 handle; - uint8 *magic; + uint16 vmin; + uint16 component; + uint16 pakid; #if WITH_DEBUG_RDP5 printf("--- rdpdr_process ---\n"); hexdump(s->p, s->end - s->p); #endif - in_uint8p(s, magic, 4); - if ((magic[0] == 'r') && (magic[1] == 'D')) + in_uint16(s, component); + in_uint16(s, pakid); + + if (component == RDPDR_CTYP_CORE) { - if ((magic[2] == 'R') && (magic[3] == 'I')) - { - rdpdr_process_irp(s); - return; - } - if ((magic[2] == 'n') && (magic[3] == 'I')) - { - rdpdr_send_connect(); - rdpdr_send_name(); - return; - } - if ((magic[2] == 'C') && (magic[3] == 'C')) + switch (pakid) { - /* connect from server */ - rdpdr_send_clientcapability(); - rdpdr_send_available(); - return; - } - if ((magic[2] == 'r') && (magic[3] == 'd')) - { - /* connect to a specific resource */ - in_uint32(s, handle); + case PAKID_CORE_DEVICE_IOREQUEST: + rdpdr_process_irp(s); + break; + + case PAKID_CORE_SERVER_ANNOUNCE: + /* DR_CORE_SERVER_ANNOUNCE_REQ */ + in_uint8s(s, 2); /* skip versionMajor */ + in_uint16_le(s, vmin); /* VersionMinor */ + in_uint32_le(s, g_client_id); /* ClientID */ + + /* The RDP client is responsibility to provide a random client id + if server version is < 12 */ + if (vmin < 0x000c) + g_client_id = 0x815ed39d; /* IP address (use 127.0.0.1) 0x815ed39d */ + g_epoch++; + + rdpdr_send_client_announce_reply(); + rdpdr_send_client_name_request(); + break; + + case PAKID_CORE_CLIENTID_CONFIRM: + rdpdr_send_client_device_list_announce(); + break; + + case PAKID_CORE_DEVICE_REPLY: + in_uint32(s, handle); #if WITH_DEBUG_RDP5 - DEBUG(("RDPDR: Server connected to resource %d\n", handle)); + DEBUG(("RDPDR: Server connected to resource %d\n", handle)); #endif - return; - } - if ((magic[2] == 'P') && (magic[3] == 'S')) - { - /* server capability */ - return; + break; + + case PAKID_CORE_SERVER_CAPABILITY: + rdpdr_send_client_capability_response(); + break; + + default: + unimpl("RDPDR pakid 0x%x of component 0x%x\n", pakid, component); + break; + } } - if ((magic[0] == 'R') && (magic[1] == 'P')) + else if (component == RDPDR_CTYP_PRN) { - if ((magic[2] == 'C') && (magic[3] == 'P')) - { + if (pakid == PAKID_PRN_CACHE_DATA) printercache_process(s); - return; - } } - unimpl("RDPDR packet type %c%c%c%c\n", magic[0], magic[1], magic[2], magic[3]); + else + unimpl("RDPDR component 0x%x\n", component); } RD_BOOL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/sc.c new/rdesktop-1.8.3/sc.c --- old/rdesktop-1.8.2/sc.c 2014-05-20 16:29:23.000000000 +0200 +++ new/rdesktop-1.8.3/sc.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -#include <cardmon.h> - -int -main(int argc, char **argv) -{ - CARD_DATA cd; - PCARD_DATA pcd; - - memset(pcd, 0, sizeof(cd)); - - return 0; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/scard.c new/rdesktop-1.8.3/scard.c --- old/rdesktop-1.8.2/scard.c 2014-05-20 16:29:23.000000000 +0200 +++ new/rdesktop-1.8.3/scard.c 2014-09-11 13:54:46.000000000 +0200 @@ -3,7 +3,7 @@ Smart Card support Copyright (C) Alexi Volkov <[email protected]> 2006 Copyright 2010-2013 Pierre Ossman <[email protected]> for Cendio AB - Copyright 2011-2013 Henrik Andersson <[email protected]> for Cendio AB + Copyright 2011-2014 Henrik Andersson <[email protected]> for Cendio AB This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ static pthread_mutex_t **scard_mutex = NULL; -static uint32 curDevice = 0, curId = 0, curBytesOut = 0; +static uint32 curEpoch = 0, curDevice = 0, curId = 0, curBytesOut = 0; static PSCNameMapRec nameMapList = NULL; static int nameMapCount = 0; @@ -87,11 +87,12 @@ #endif /* MAKE_PROTO */ void -scardSetInfo(uint32 device, uint32 id, uint32 bytes_out) +scardSetInfo(uint32 epoch, uint32 device, uint32 id, uint32 bytes_out) { curDevice = device; curId = id; curBytesOut = bytes_out; + curEpoch = epoch; } #ifndef MAKE_PROTO @@ -1175,6 +1176,11 @@ memset(myRsArray, 0, dwCount * sizeof(SERVER_SCARD_READERSTATE_A)); copyReaderState_ServerToMyPCSC(rsArray, myRsArray, (SERVER_DWORD) dwCount); + /* Workaround for a bug in pcsclite, timeout value of 0 is handled as INFINIT + but is by Windows PCSC spec. used for polling current state. + */ + if (dwTimeout == 0) + dwTimeout = 1; rv = SCardGetStatusChange(myHContext, (MYPCSC_DWORD) dwTimeout, myRsArray, (MYPCSC_DWORD) dwCount); copyReaderState_MyPCSCToServer(myRsArray, rsArray, (MYPCSC_DWORD) dwCount); @@ -2451,6 +2457,7 @@ data->memHandle = lcHandle; data->device = curDevice; data->id = curId; + data->epoch = curEpoch; data->handle = handle; data->request = request; data->in = duplicateStream(&(data->memHandle), in, 0, SC_TRUE); @@ -2522,7 +2529,14 @@ size_t buffer_len = 0; scard_device_control(data->handle, data->request, data->in, data->out); buffer_len = (size_t) data->out->p - (size_t) data->out->data; - rdpdr_send_completion(data->device, data->id, 0, buffer_len, data->out->data, buffer_len); + + /* if iorequest belongs to another epoch, don't send response + back to server due to it's considered as abdonend. + */ + if (data->epoch == curEpoch) + rdpdr_send_completion(data->device, data->id, 0, buffer_len, data->out->data, + buffer_len); + SC_destroyThreadData(data); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/scard.h new/rdesktop-1.8.3/scard.h --- old/rdesktop-1.8.2/scard.h 2014-05-20 16:29:22.000000000 +0200 +++ new/rdesktop-1.8.3/scard.h 2014-09-11 13:54:46.000000000 +0200 @@ -154,6 +154,7 @@ { uint32 device; uint32 id; + uint32 epoch; RD_NTHANDLE handle; uint32 request; STREAM in; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/seamless.c new/rdesktop-1.8.3/seamless.c --- old/rdesktop-1.8.2/seamless.c 2014-05-20 16:29:23.000000000 +0200 +++ new/rdesktop-1.8.3/seamless.c 2014-09-11 08:36:25.000000000 +0200 @@ -3,7 +3,7 @@ Seamless Windows support Copyright 2005-2008 Peter Astrand <[email protected]> for Cendio AB Copyright 2007-2008 Pierre Ossman <[email protected]> for Cendio AB - Copyright 2013 Henrik Andersson <[email protected]> for Cendio AB + Copyright 2013-2014 Henrik Andersson <[email protected]> for Cendio AB This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ extern RD_BOOL g_seamless_rdp; static VCHANNEL *seamless_channel; static unsigned int seamless_serial; +static char *seamless_rest = NULL; static char icon_buf[1024]; static char * @@ -373,7 +374,6 @@ seamless_process(STREAM s) { unsigned int pkglen; - static char *rest = NULL; char *buf; pkglen = s->end - s->p; @@ -385,7 +385,7 @@ hexdump(s->p, pkglen); #endif - str_handle_lines(buf, &rest, seamless_line_handler, NULL); + str_handle_lines(buf, &seamless_rest, seamless_line_handler, NULL); xfree(buf); } @@ -405,6 +405,15 @@ return (seamless_channel != NULL); } +void +seamless_reset_state(void) +{ + if (seamless_rest != NULL) + { + xfree(seamless_rest); + seamless_rest = NULL; + } +} static unsigned int seamless_send(const char *command, const char *format, ...) @@ -533,3 +542,15 @@ return res; } + +unsigned int +seamless_send_persistent(RD_BOOL enable) +{ + unsigned int res; + if (!g_seamless_rdp) + return (unsigned int) -1; + printf("%s persistent seamless mode.\n", enable?"Enable":"Disable"); + res = seamless_send("PERSISTENT", "%d", enable); + + return res; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rdesktop-1.8.2/xwin.c new/rdesktop-1.8.3/xwin.c --- old/rdesktop-1.8.2/xwin.c 2014-05-20 16:29:23.000000000 +0200 +++ new/rdesktop-1.8.3/xwin.c 2014-07-03 12:42:04.000000000 +0200 @@ -95,6 +95,7 @@ static RD_BOOL g_seamless_hidden = False; /* Desktop is hidden on server */ static RD_BOOL g_seamless_broken_restack = False; /* WM does not properly restack */ extern RD_BOOL g_seamless_rdp; +extern RD_BOOL g_seamless_persistent_mode; extern uint32 g_embed_wnd; RD_BOOL g_enable_compose = False; @@ -2121,6 +2122,7 @@ if (g_seamless_rdp) { + seamless_reset_state(); seamless_restack_test(); } @@ -3822,7 +3824,12 @@ ui_seamless_toggle(); if (g_seamless_spawn_cmd[0]) + { seamless_send_spawn(g_seamless_spawn_cmd); + g_seamless_spawn_cmd[0] = 0; + } + + seamless_send_persistent(g_seamless_persistent_mode); } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
