The data in 'struct xrdp_client_info' which is shared with xorgxrdp
is separated out into a separate structure. This makes it simpler to
change 'struct xrdp_client_info' without affecting xorgxrdp.
From https://github.com/cktan/tomlc99, merge commits after
894902820a3ea2f1ec470cd7fe338bde54045cf5 (2022-09-12) up to and including
df627177cd1e80176c7a5245f26fd3b8e6187368 (2025-05-01)
The Latvian keyboard corresponding to code 0x426 is totally different
from the keyboard for 0x10426 (Latvian(QWERTY)) and 0x20426
(Latvian(Standard)). We set up new definitions for 0x426 and 0x10426 and
symlink 0x20426 to 0x10426.
1) In FIPS mode, Classic RDP security is not allowed at all.
2) In FIPS mode xrdp-keygen creates an empty file
3) Documentation wording improved around the security_level setting
4) Logging improved around the security negotiation
5) Warnings now generated if Classic RDP security is negotiated
1) Remove 'magic numbers' related to static channel name lengths, and
replace with CHANNEL_NAME_LEN, or CHANNEL_NAME_LEN+1, as appropriate.
2) Always add static channel definitions, even if they are malformed.
3) Log channels which the client sends, which aren't named in
the [Channels] section of xrdp.ini.
(cherry picked from commit 9092d898b7dceda713bd05b296ea8e8213ee614b)
Cater for xrdp_mm_get_value() returning NULL in a couple of places.
Also:-
- The function parse_chansrvport() now checks that passed-in value
isn't NULL.
- Unnecessary uses of g_strncpy replaced with strlcpy()
These Coverity warnings all relate to the user of g_setenv() where the
return result isn't checked.
An additional void function g_setenv_log() is provided which logs
failures to set environment variables, and returns no status. This is
used in all the places where g_setenv_is currently called.
The datasize variable is an unsigned in, so comparing it to < 0 will
never be true. There is also a printf sequence for the variable which
should be %u rather than %d
Missing break statement in a switch intoduced by commit
54acca43cf
The results of this are benign, as the extra code which is run is
unlikely to do anything.
Later versions of Ubuntu (e.g. 24.10 and later) do not install
the systemd-dev package by default. This breaks the systemd-detection
mechanism.
Add this package in for non-systemd-based Debian distributions. Also
log what we are doing for systemd as part of the configure.
Replace uses of g_strncpy() in xrdp_init_xkb_layout() with the more
correct strlcpy().
In addition, some values and pointers which do not need to be
writeable have been made const.
xrdp contains two functions which do similar things:-
- g_htoi() converts a hex string to an integer, ignoring unrecognised
characters
- xrdp_wm_htoi() converts a hex string to an integer, ignoring leading
whitespace, but terminating on unrecognised characters
An analysis of the uses of g_htoi() shows that the only place where
unrecognised characters might be encountered is parsing lines from
xrdp_keyboard.ini, where all values have an '0x' prefix (i.e. the 'x'
is unrecognised)
An analysis of xrdp_wm_htoi() shows that the functionality to ignore
leading whitespace is not used.
Both functions are replaced with a re-written g_htoi() which is const-
correct and provided with test cases. This function behaves in
the same way as the atoi() library function, in that it terminates on
an unexpected character.
The use of g_htoi() in parsing lines from xrdp_keyboard.ini is replaced
with a call to g_atoix() which handles the '0x' prefix correctly.
This allows sesman to detect failed sessions before it tells xrdp
that all is OK with the session. This is a fairly common failure mode
which can now be reported on the login screen.