Commit Graph

4803 Commits

Author SHA1 Message Date
matt335672 3bfa59472e Fix misreported cache size
Printed offscreen bitmap cache size is in bytes, not MB.
2024-08-16 11:18:15 +01:00
matt335672 9f59c6aafc
Merge pull request #3206 from matt335672/ubuntu_2404_ci
Make xrdp compatible with github runner ubuntu-24.04
2024-08-15 12:14:42 +01:00
matt335672 2aeec83bab Remove unnecessary autoconf AC_C_CONST macro 2024-08-15 11:48:23 +01:00
matt335672 c0a13e4471 Add additional dependency for configure for cppcheck CI 2024-08-15 11:48:23 +01:00
matt335672 abbc1076bc
Merge pull request #3204 from matt335672/update_librfxcodec
Update librfxcodec
2024-08-15 11:11:27 +01:00
matt335672 11be388f17 Update librfxcodec
Update librfxcodec for latest performance changes
2024-08-14 15:53:06 +01:00
matt335672 ba0b6fd6fe
Merge pull request #3196 from matt335672/fix_librfxcodec_version
Fix librfxcodec version
2024-08-06 10:37:08 +01:00
matt335672 b418f657a9 Fix librfxcodec version
My bad. When I merged ba1d93930a just now.
I overwrote the version of librfxcodec with an old one. This commit
fixes that.
2024-08-06 10:10:23 +01:00
matt335672 8fd941632d
Merge pull request #3138 from matt335672/update_scancode_processing
Update scancode processing
2024-08-06 09:39:41 +01:00
matt335672 3f568b42fb Store TS_SYNC_EVENT before module load
When a connection is made to a system with the client numlock pressed, a
TS_SYNC_EVENT is sent before the module is loaded. This TS_SYNC_EVENT
correctly contains the NumLock status as 'pressed'. The event is, however,
discarded as the module isn't loaded.

When the module is loaded, a TS_SYNC_EVENT is not sent again unless
client focus is removed from the xrdp window and re-applied. As a
result, the NumLock state is incorrect unless this is done.

This commit stores the last TS_SYNC_EVENT sent before a module is
loaded. When the module is loaded, the sync state can be correctly
communicated to the module.
2024-08-05 10:58:09 +01:00
matt335672 ba1d93930a Allow keycode set to be specified for the X server
This commit allows a keycode_set to be specified as a module parameter
in xrdp.ini. This has the following effects:-
1) xrdp loads the specified keycode set for mapping RDP scancodes to
   X11 keycodes. These are then passed to xorgxrdp as part of key press/
   key release events.
2) The name of the XKB rules which use the specified keycode set are
   passed to xorgxrdp so that XKB can be configured with rules which
   match the chosen keycodes.

The effect is to remove all keycode set dependencies from xorgxrdp.
Normally evdev rules and evdev keycodes will be used but base rules and
base keycodes can be used instead for applications that require them.
Also, any systems which do not ship the evdev rules can be made to
work with base rules.
2024-08-05 10:58:09 +01:00
matt335672 c9a2039858 Move and rename xrdp_load_keyboard_layout()
xrdp_load_keyboard_layout() is used exclusively by the xup module to
work out the parameters to pass to xorgxrdp for XKB. This function
does not need to be called locally from the SEC module.

This commit moves the function to xrdp/lang.c and renames it as
xrdp_init_xkb_layout(). The module interface is modified so that xup can
call this function. Other modules do not need to call it.
2024-08-05 10:44:10 +01:00
matt335672 d83fc8a93f Add xrdp_scancode_defs.h
Add a development header xrdp_scancode_defs.h which contains
common scancode definitions for xrdp and xorgxrdp
2024-08-05 10:44:10 +01:00
matt335672 37348d362c Regenerate keymaps
Regenerate keymaps with pause key and ABNT2 keypad point
keys added.
2024-08-05 10:44:10 +01:00
matt335672 dc696f5b7f Add missing scancode map for ABNT2 KPPT
The Brazilian ABNT2 Keyboard layout contains a keypad
decimal key which doesn't exist on other keypads:-

https://www.kbdlayout.info/kbdbr/virtualkeys

This key is curently mapped in xorgxrdp to keycode 134 (basic mapping),
but isn't present in the scancode map. It needs to be added so that it
is available to VNC sessions and will be mapped for xorgxrdp when we
move to evdev keycode mappings.
2024-08-05 10:44:10 +01:00
matt335672 7fe5b3ea34 Move pause key processing from xorgxrdp
This commit moves processing of the pause key from xorgxrdp
back to xrdp itself, so that the key can be passed to the VNC
backend.
2024-08-05 10:44:10 +01:00
matt335672 5779edd23f Replace magic numbers in keyboard code with defs
- All scancode definitions are moved to scancode.h
- Magic numbers are replaced where applicable with definitions
2024-08-05 10:44:10 +01:00
matt335672 ef14039c62 Use correct names for key events
Replace definitions in ms-rdpbcgr.h marked as TODO with the
names defined in [MS-RDPBCGR]

Some other simplifications around the fake Unicode event processing
have also been made.
2024-08-05 10:44:10 +01:00
matt335672 43d6db45ed Add module test for scancode index conversions 2024-08-05 10:44:10 +01:00
matt335672 c91ef80ca9 Implement scancode indexing
The mapping from scancodes to the indexes used in xrdp_keymap
is not well designed and contains an implicit dependency on
keycode values.

This mapping is alse slightly different from the index used for
the 'keys' map in the xrdp_wm structure.

This commit introduces support for mapping scancodes directly
to 'scancode indexes' suitable for indexing into both structures.

Some renaming is also done; [MS-RDPBCGR] uses the terms scancode
and keyCode interchangeably. An effort is made to use key_code for a
raw value from a TS_KEYBOARD_EVENT, and scancode for a value which is
produced by the scancode module.
2024-08-05 10:44:10 +01:00
matt335672 d82a172b55
Merge pull request #3173 from matt335672/chansrv_clip_fixes
Chansrv clip fixes
2024-08-05 09:49:08 +01:00
matt335672 0f6e731524 clipboard: Allow a file read to return 0 for EOF
When used with a FreeRDP client on Linux, a file copy operation from
the clipboard detects end-of-file by a read returning 0 bytes. This is
currently marked as an error.

It is assumed that mstsc.exe detects end-of-file in another way, which
is why this has not been found before.
2024-08-02 12:41:20 +01:00
matt335672 34b5582460 Remove unnecessary copy from clipboard_get_files()
The routine clipboard_get_files() parses a potentially long string,
and copies portions of it into a temporary buffer. This buffer is then
passed to clipboard_get_file() as pointer + length;

The buffer is inadequately sized for very long filenames which may
approach XFS_MAXFILENAMELEN in length. This can cause chansrv to fail
when the user copies such filenames.

It turns out the buffer is unnecessary, as the filenames can be
passed directly into clipboard_get_file() from the source string,
using pointer + length. This avoids the length limitation entirely.
2024-08-02 12:41:20 +01:00
matt335672 c3f7eec4f5 Allow for longer filenames from the redirector.
This commit ensures that filenames up to the maximum size supported
by our xfs can be supported.
2024-08-02 12:41:20 +01:00
matt335672 a90228241d Remove hard-coded filename limit for clipboard file lists
The limit of 256 characters for clipboard files is limiting for
many Asian locales, particularly as '%xx' notation is used to
communicate bytes with bit 7 set.
2024-08-02 12:41:20 +01:00
matt335672 d8b5435710 Dynamically allocate XFS filesystem names
Replace the 256 byte buffer used for names in the XFS filesystem with a
dynamically allocated buffer.

The define XFS_MAXFILENAMELEN which used to be 255 has been retained,
but bumped to 1023. This value is no longer used for long-lived
allocations, but is used in chansrv_fuse.c for maintaining state
information for in-fligh I/O requests.
2024-08-02 12:41:20 +01:00
metalefty f1d3b21177
Merge pull request #3189 from metalefty/tarball
Include {xrdp,sesman}.ini.in instead of substituted .ini in tarball
2024-08-01 21:17:43 +09:00
Koichiro Iwao 5e95fc0cb3 Include {xrdp,sesman}.ini.in instead of substituted .ini in tarball
These config files are intended to be substituted during the build
process. The substituted .ini files should not be included in release
tarballs.

Fixes:  #3187
(cherry picked from commit 19bacc6e49)
2024-08-01 20:40:25 +09:00
metalefty ecebe4588a
Merge pull request #2973 from metalefty/compression-level-options
GFX: selectable lossy compression levels
2024-07-30 10:22:20 +09:00
matt335672 597d30b6e2
Merge pull request #3172 from matt335672/fix_potential_name_overflow
Fix potential name buffer overflows in redirector
2024-07-23 12:29:03 +01:00
matt335672 c9e84dc16c Fix potential name buffer overflows in redirector
The state buffers used by the following structs in chansrv_fuse.c
are one byte too small for filenames of length XFS_MAXFILENAMELEN:-
- struct state_lookup
- struct state_create
- struct state_rename

In practice, there is no runtime danger, as XFS_MAXFILENAMELEN is 255,
and these buffers will be followed by non-byte aligned data. Nevertheless
this should be fixed to prevent problems if the value is changed.
2024-07-22 14:44:58 +01:00
matt335672 4bfeb668e1
Merge pull request #3170 from matt335672/fix_missing_pre_session_ipaddr
sesman: Copy IP address to pre_session_item struct
2024-07-22 09:46:08 +01:00
matt335672 a4f57572e6 sesman: Copy IP address to pre_session_item struct
struct pre_session_item has an entry for the start_ip_addr which is not
being filled in. This is not normally needed, as the IP address of the
session is passed into the session another way, but it is needed if the
session selection Policy contains the 'I' selector.
2024-07-19 11:57:55 +01:00
matt335672 b6407a9bf9
Merge pull request #3143 from matt335672/remove_licensing_exchange
Remove Licensing exchange
2024-07-15 09:02:32 +01:00
jsorg71 2a8eea90de
Merge pull request #3161 from jsorg71/link1
link error dlclose, use DLOPEN_LIBS
2024-07-13 22:46:26 -07:00
Jay Sorg ce27b373c1 link error dlclose, use DLOPEN_LIBS 2024-07-13 12:13:52 -07:00
metalefty f1ba92b35e
Merge pull request #3159 from metalefty/xrdp_as_unprivileged_user
chkpriv: respect $sysconfdir for config files directory
2024-07-13 21:46:20 +09:00
Koichiro Iwao c2b8cbf19e chkpriv: respect $sysconfdir for config files directory
While here, ignore build artifacts of chkpriv tools.

Follow-up to:   #2974
2024-07-12 11:11:06 +09:00
metalefty 19c111c74c
Merge pull request from GHSA-7w22-h4w7-8j5j
Enforce no login screen if require_credentials is set
2024-07-11 09:37:12 +09:00
metalefty 10c4700e9a
Merge pull request #3154 from metalefty/update-submodule
Support screens larger than 4096 pixels (update submodule)
2024-07-09 20:11:35 +09:00
Koichiro Iwao 8caadb370f Support screens larger than 4096 pixels (update submodule)
Fixes:  #3083
2024-07-09 15:10:40 +09:00
metalefty a1f148d307
Merge pull request #3151 from metalefty/makedist
docs: always include docs/man/xrdp-mkfv1.8.in to dist tarball
2024-07-08 21:52:33 +09:00
Koichiro Iwao ab383ed713 docs: always include docs/man/xrdp-mkfv1.8.in to dist tarball
Files included in distribution tarball must always be enumerated,
not be enumerated conditionally.

Resolves:   #3149
(cherry picked from commit e83dcc52eb)
2024-07-08 21:31:53 +09:00
matt335672 52dd88b576 Replace binary blob with specified data
This commit changes the license response PDU to be constructed rather
than simply being contained as a binary blob.

Some constants in common/ms-rdpbcgr.h are renamed with the values
from the specification.
2024-07-03 14:20:33 +01:00
matt335672 cc4a4c95f2 Remove Licensing exchange
Replaces the existing licensing exchange with a single PDU
saying the user will not issue a license.

This is necessary for clients on FIPS-compliant systems, as these
are unable to decode the licensing exchange packets, due to outdated
cyphers.
2024-07-03 14:19:22 +01:00
matt335672 fced0002bd
Merge pull request #2974 from matt335672/xrdp_as_unprivileged_user
Xrdp as unprivileged user
2024-07-02 08:56:55 +01:00
matt335672 0ebf4cff13 Check unprivileged user can't write TLS files
The unprivileged user needs to be able to read the certificate and
key files to offer TLS, but should not be able to write to then.

This commit checks the TLS files are read-only, rather than
simply readable
2024-07-01 14:25:23 +01:00
matt335672 48255da29a Add xrdp-chkpriv script to check xrdp privileges 2024-07-01 11:11:21 +01:00
matt335672 ce355fc235 Allow for xrdp not being able to delete PID file
If xrdp is running with dropped privileges it won't be able to delete
the PID file it's created. Places where xrdp is stopped need to cater
for this.

It's prefereable to do this than make the PID file writeable by xrdp
with dropped privileges, as this can still lead to DoS attacks if an
attacker manages to modify the PID file from a compromised xrdp
process.
2024-07-01 11:11:21 +01:00
matt335672 b1d8428579 Add code to drop privileges of xrdp daemon 2024-07-01 11:11:21 +01:00