When xrdp is built with IPv6 support it will only fall back to IPv4 if
IPv6 is not supported (EAFNOSUPPORT). However, if the system is IPv6
capable but doesn't have an IPv6 address set (at least inside a FreeBSD
jail) EPROTONOSUPPORT is returned from socket().
When a resize is underway on a busy X server, it is possible for a
queued EGFX cmd (order #62) to be processed after the decoder has been
deleted. This causes a client disconnect with no useful error message.
The '-lrt' added to the Makefile for the common library appears
to be unnecessary.
- On modern Linuxes, this library has been merged with libc, and the
supplied library is empty.
- On older ones (e.g. Devuan 4), the library contains routines we
do not use in xrdp (although we use 'shm_open()' in xorgxrdp).
- On FreeBSD 14 the library contains only mq_* and timer_* routines
which, again, are not required.
g_strncpy() is the wrong function for copying strings in struct utmp[x]
as it always terminates strings.
strncpy() itself would be a good choice, but is marked by many compilers
as being unsafe to use.
str2memcpy() is taken from util-linux, and is exactly right for this
application.
POSIX.1 doesn't define ut_host in struct utmpx. Also, Linux has support
for an exit status value in ut_exit. This commit adds conditional code
for both ut_host and ut_exit to maximise portability.
- renamed the two files, including the header was conflicting with official headers
- configure look for utmp/utmpx headers, wo we know which struct to use
- reworked the usage for linux, works mostly (last still showing 'gone' for loggued users)
In GFX mode, if we're using xorgxrdp, frame updates are send directly
from the client, bypassing the screen buffer in xrdp_mm.
This commit only allows the xrdp_mm screen buffer to be invalidated
if the painter has drawn into it since the module was loaded. This
prevents the unused (and invalid) frame buffer being pushed to the client
in GFX mode with xorgxrdp.
Input message 300 to xorgxrdp which communicated a screen size
has been replaced with message 302 which sends a list of monitors
to xorgxrdp. This simplifies the initialisation and resize logic
somewhat, but a compatible version of xorgxrdp must be used
Significant updates for the VNC module:-
1) Support for the new API calls allowing both server and client
multi-monitor resizes.
2) The s member variable of the vnc_screen_layout structure is no longer
dynamically allocated.
3) The module server_width and server_height member variables are
removed as these are just duplicating server_layout.total_width and
server_layout.total_height.
4) When the server screens are resized, there is no need to restart the
entire resize state machine as we already know at this point that
the server supports resizing.
This commit DOES NOT compile.
This change alters these module interface calls:-
1) mod_server_monitor_resize() (Call from xrdp to module). Updated.
2) server_reset() (Call from module to xrdp). Replaced.
The mod_server_monitor_resize() call is updated :-
1) to allow a monitor list to be passed in for a multimon resize
2) with an 'in_progress' return value which tells the caller whether or
not to expect a callback.
The server_reset() call served two purposes up until now:-
1) To allow a module to resize a single monitor session. There
is no way to request a multi-monitor resize from the module
2) (with bpp == 0) To signal to the mm resize state machine that
a server screen resize hsa finished.
This is split into two calls:-
1) client_monitor_resize() to allow a mdule to request a
multimon resize.
2) server_monitor_resize_done(). This is called by a module
when a resize is completed.
From [MS-RCPBCGR] 3.3.5.12.1:-
> ...The contents of this PDU SHOULD NOT be compressed.
>
> This PDU MUST NOT be sent to a client that has not indicated support for
> it by setting the RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU flag (0x0040)
> in the earlyCapabilityFlags field of the Client Core Data (section
> 2.2.1.3.2).
Also, 2.2.12.1 specifies the source channel must be zero.
In testing, a compressed monitor layout PDU causes mstsc.exe
to exit with a protocol error.