Commit Graph

1989 Commits

Author SHA1 Message Date
Karl Mikaelsson
5c48d5d788
Revert "Reconnect-related fixes" 2018-03-23 15:49:11 +01:00
Karl Mikaelsson
8346fea6cc
Merge pull request #249 from derfian/reconnect-related-fixes
* When connecting to a Windows 2008 Server, pressing Cancel or hitting Escape while entering credentials (on the server) would lead to a reconnect if there was a resize pending.

* When connecting to a RDS farm name (round robin DNS entry as per MS recommendations), reconnecting could connect you to a different server, leading to a login screen rather than your session.

* rdesktop never had any logging that told you which address you were connecting to.
2018-03-23 09:38:17 +01:00
Karl Mikaelsson
d6c99bf599 Save and re-use resolved address for given hostname
If tcp_connect is called with the same server name, don't look up the
address again. This avoids connecting to other servers when using a
round-robin RDS farm name, as recommended by Microsoft.

This introduces a backwards-incompatible change. If rdesktop was
reconnecting because the user was moving between networks and the
server is no longer reachable on the same address, the user must
re-start rdesktop to reach their server.
2018-03-22 15:36:36 +01:00
Karl Mikaelsson
8c9c52abd2 Don't check server error codes if the server didn't disconnect us
When a user presses cancel in the login dialog on a session on Windows
2008 R2 while a resize was pending, the user would be reconnected to
the session rather than disconnected.

A naive fix for this problem led to problems where reconnecting to
resize a session led to the user being disconnected instead.

The solution for both of these problems is to only look at the error
code sent by the server is if the connection also was deactivated at
the time of the disconnect. In just about all other cases, a
disconnect/main loop quit when the connection is active should result
in a reconnect. The sole exception is if the user closed the rdesktop
window, in case rdesktop also should exit.
2018-03-22 15:31:37 +01:00
Cendio
4580492c12 Prefer online resize over reconnect resizes
We had a case on Windows 2012R2 where any early resizes would be
handled by a reconnect rather than an online resize, which led to a
bunch of follow-up problems with the session startup.

To solve this, we gave the RDPEDISP channel more time to become
established.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-03-07 10:49:25 +01:00
Cendio
62ea190c0c Exit rdesktop if error info is set
This fixes a problem where a connect loop is triggered
when a user is closing the session and there is a pending
resize triggered. When server sends error info PDU, this
means that the client should close and not enter a
reconnect due to pending resize or other reason such as
network error or redirect...

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
Co-authored-by: Thomas Nilefalk <thomas@nilefalk.se>
2018-03-01 13:52:54 +01:00
Cendio
a0af72a337 Fix fullscreen toggle when dynamic session resize is disabled
When dynamic session resize is disabled, leaving fullscreen should
result in a window that matches the session size.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-14 10:49:39 +01:00
Cendio
8bc2cea80f Add check if we can use dynamic session resize
When the server does not comply with our initial session size
request, we disable the dynamic session resize feature.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-14 10:49:30 +01:00
Cendio
9d163423eb Fullscreen windows should not be resized to match the session size
Given that a fullscreen window should have the same size as the
screen, when the server tells us a session size, then we can't
resize the fullscreen window.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-13 14:14:02 +01:00
Alexander Zakharov
ad3ed6bcf0
Merge pull request #238 from uglym8/pcsc_v2_part10
Fix scard handling of PCSCv2 Part 10.
2018-02-09 14:39:48 +03:00
Alexander Zakharov
e3fbadfcf5 Fix scard handling of PCSCv2 Part 10.
We must not modify any features codes before sending
them off to Windows.
2018-02-09 14:34:01 +03:00
Karl Mikaelsson
08c293b405 Fix Fast-Path PDU decryption regression
This solves a problem where rdesktop would get really confused about
the data read from the server and crash in random places just after
connecting.
2018-02-02 17:13:36 +01:00
Henrik Andersson
fe8438d5c3
Merge pull request #245 from derfian/implicit-fallthrough
Remove implicit fall-throughs from bitmap.c and parallel.c
2018-02-01 16:31:29 +01:00
Karl Mikaelsson
50edf775e6
Merge pull request #236 from hean01-cendio/fastpath_cleanup
Refactoring of slow and fastpath handling and rdp_recv()
2018-02-01 14:39:25 +01:00
Henrik Andersson
1a82d4139b Cleanup of rdp_loop() and rdp_recv() for clarity 2018-02-01 13:12:57 +01:00
Henrik Andersson
b5708cf775 Refactoring of slow and fastpath handling
This changes clarifies a chunk of code related to receiving
data and handle slow and fast path pdus.
2018-02-01 12:47:22 +01:00
Karl Mikaelsson
1cdf4e87cb Remove implicit fall-throughs from bitmap.c and parallel.c 2018-01-31 15:04:49 +01:00
Cendio
81c030a887 Fix reconnect-loop going from initial fullscreen on Unity
Moving responsibility for actual resize to process_pending_resize()
Cleaning up duplicated calculation of session size
Removing handling of percentage of screen for now

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
58d8f78eea Add lots of protocol debug logging
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
3e2867e7ac Flush stdout for proper order of log messages
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
07abc9bade Defer pending resize until after autoreconnect cookie is received
Resize session using disconnect/reconnect sequence should not be
performed before we have received an auto-reconnect cookie which is
used for reconnecting to the session. There is a race when trying to
reconnect at this point so a defer timer is used to delay this further
from the point where the auto-reconnect cookie is received.

Fixes a problem where a login prompt is shown upon reconnect even if
the auto-reconnect cookie is available and used.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
e112b69c61 Use proper user-initiated disconnect sequence
A correct user initated disconnect sequence should send
a MCS Disconnect Provider Ultimatum PDU defined in T.128
upon a disconnect. This commit adds the implementation
the mentioned PDU and the actual write of the packet.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
2018-01-31 11:03:32 +01:00
Cendio
293680c034 Use hex constants for data pdu (pdutype2) enumeration
This matches how they're described in MS-RDPBCGR. Also add the proper
constant name as comments.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
37da672908 Added ber_out_sequence() util for writing ASN.1 sequences
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
bdb92839f3 Add test for Conference Join Request packet creation
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-31 11:03:32 +01:00
Alexander Zakharov
585f319aea
Merge pull request #237 from shweew/patch-1
Update 'ru' keymap to correct CapsLock handling.
2018-01-30 22:31:38 +03:00
Alexander Zakharov
f7e4195766
Merge pull request #241 from kekePower/gcc730compilationfix
Fix compile issue for "-Werror=format-security" option (e.g. gcc 7.3.0)
2018-01-30 18:24:55 +03:00
kekePower
8376afac54
Fix to compile with GCC 7.3.0 and possibly fix a security issue
Did a google search and found this.
https://stackoverflow.com/questions/4419293/warning-format-not-a-string-literal-and-no-format-arguments/4419319#4419319

With this little fix, rdesktop compiled again using gcc 7.3.0.
2018-01-29 20:35:44 +01:00
Henrik Andersson
54c38f7f62
Merge pull request #240 from rdesktop/fix_issue228
Clear g_exit_mainloop before new connection
2018-01-29 14:10:38 +01:00
Cendio
2491a3c436 Clear g_exit_mainloop before new connection
Reuse of g_exit_mainloop can occur at various situations
such as on redirection, when a new connection is initialized.

If you call rdp_loop with this flag set, things will not work as
you'd expect.

Fixes issue #228

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-29 14:05:16 +01:00
Dmitriy Shweew
70b3c7c852
Update ru 2018-01-27 09:39:49 +04:00
Karl Mikaelsson
da5153c578
Merge pull request #212 from derfian/rdp-rename-client-and-error-info-pdus
Rename functions that send Client Info PDU and handle Set Error Info PDU
2018-01-25 17:15:22 +01:00
Karl Mikaelsson
2f6cd4df7e Improve handling/code of Set Error Info PDU
Renamed to function to match the PDU it was processing. Removed the
function from proto.h and made it static - there's nothing calling
this from outside of rdp.c. Fixed the logging output to output the
error code instead of the pointer value.
2018-01-25 16:47:17 +01:00
Karl Mikaelsson
ca5c0adefd Rename rdp_send_logon_info to rdp_send_client_info_pdu 2018-01-25 16:47:17 +01:00
Henrik Andersson
cf32cb497a
Merge pull request #211 from uglym8/fix_disk_issues
Fix file sizes for redirected disks
2018-01-24 10:16:39 +01:00
Henrik Andersson
1553760a1e
Merge pull request #232 from rdesktop/dynamic_resize_fixes
Dynamic resize fixes and some refactor
2018-01-11 17:47:35 +01:00
Cendio
a6d82619ee Fix regression introduced in commit 85c10b5
There was either an X11 BadMatch error crash or the
rdesktop main window disappeared when toggling from
window to fullscreen. The bug is consitently
reproducible but only on some systems, maybe this is
a X11 version dependent bug. Move back to old beahavior
were we destroy and recreate the window when toggling
between fullscreen and windowed mode.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
2018-01-11 15:10:05 +01:00
Cendio
1f3d1fb3e0 Refactor handling of user requested window sizes
Extract ui_init_connection() into smaller functions
to clarify purpose.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
884f56a8e7 Fixed failing fullscreen toggle in disconnect/reconnect mode
When starting rdesktop with a fixed window size against W2008R2,
toggling to fullscreen failed to resize window to expected fullscreen
size.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
7f76e2218a Rename of global variable for clarity
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
bcd676dacc Remove double definition of global variables in test
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
8ef9f39aa8 Avoid fight about requested session size upon disconnect/reconnect resize.
Move ui_init_connection() outside main loop since it is the source for the
fight of requested session size after a resize reconnect. This should only
be called once for setting up initial requested session size via command
line args.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
ba41f749c6 Refactor g_sizeopt into an enumeration for clarity
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
e2f5a7b532 Refactor geometry string parsing
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-11 15:10:05 +01:00
Henrik Andersson
85a558a919
Merge pull request #221 from paulmenzel/improve-markup-in-readme.md
Improve markup in `README.md`
2018-01-09 15:34:19 +01:00
Paul Menzel
de290b7fc2 README.md: Mark up parameters and commands 2018-01-03 14:15:30 +01:00
Karl Mikaelsson
15af5e46df
Merge pull request #218 from paulmenzel/improve-configure-help-text
Improve configure help text
2018-01-03 13:50:46 +01:00
Paul Menzel
41eac12a59 configure.ac: Use verb in imperative mood for consistency 2018-01-03 11:42:02 +01:00
Paul Menzel
f3fdda531f configure.ac: Strip trailing spaces 2018-01-03 11:41:07 +01:00
Alexander Zakharov
c58d91c077 Fix file sizes for redirected disks 2017-12-15 20:29:37 +03:00