Commit Graph

4830 Commits

Author SHA1 Message Date
matt335672
7efcaaf027 Minor update to policy description in sesman.ini 2024-09-05 11:24:17 +01:00
matt335672
37d2c2d41b
Merge pull request #3037 from matt335672/update_cppcheck
Update cppcheck and astyle versions
2024-09-04 17:20:55 +01:00
matt335672
82c95faaa9 Allow a cppcheck check_level to be specified
Version 2.14.0 of cppcheck generates errors relating to the
check level (e.g.):-

    common/base64.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

This does not happen with the same sources (commit
f781962a55) under 2.13.0.

This PR disables the warnings above for 2.14.0, but also allows a '-f'
argument to be passed in to request an exhaustive test. This could be used
(for example) before a major release. An exhaustive test takes a *lot*
longer. The first run with a git runner was around an hour.

The --check-level=flag was only added for 2.11.0, and so this now needs
a version check.
2024-09-02 15:36:50 +01:00
matt335672
eab3cbb1d5 Bump CI tools versions
- cppcheck 2.13.0 -> 2.15.0
- astyle 3.4.12 -> 3.4.14

Release notes
- https://github.com/danmar/cppcheck/releases/tag/2.14.0
- https://github.com/danmar/cppcheck/releases/tag/2.14.1
- https://github.com/danmar/cppcheck/releases/tag/2.14.2
- https://github.com/danmar/cppcheck/releases/tag/2.15.0
- https://astyle.sourceforge.net/notes.html

Later versions of astyle up to 3.5.1 have (currently) a problem with
align-pointer=name which confuses multiplication with a
pointer-dereference. See https://sourceforge.net/p/astyle/bugs/572/
2024-09-02 15:36:50 +01:00
matt335672
af22422260 Make scripts/install_cppcheck.sh shellcheck-compatible 2024-09-02 15:36:50 +01:00
matt335672
bc3f0e63f6 Update scripts/install_cppcheck.sh for v2.15.0
Remove the setting of CPPFLAGS for cppcheck v2.15.0 as this
upsets the setting of FILESDIR
2024-09-02 15:27:34 +01:00
metalefty
27f0febb04
Merge pull request #3218 from metalefty/gfx_codec_order
GFX: add config which to prefer H264 vs RFX
2024-08-29 22:51:57 +09:00
matt335672
5351511272 Further changes to selectable H.264 support
- Fix CI errors
- tconfig_load_gfx() removes H.264 from the supported codec list
  if significant errors are found loading the H.264 configuration
- tconfig_load_gfx() always produces a usable config, even if the
  specified file can't be loaded
2024-08-29 21:02:36 +09:00
metalefty
abfa633a35
Merge pull request #3059 from chipitsine/coverity
CI: scheduled coverity scan
2024-08-29 18:14:45 +09:00
Ilia Shipitsin
a00374d1a4 CI: scheduled coverity scan 2024-08-29 10:28:08 +02:00
matt335672
1ac216da1d Rework codec order in tconfig
Replaced codec idx values with a list of codecs from the
config file.

Added some logging for debugging
2024-08-28 21:18:05 +09:00
metalefty
e251512ba4
Merge pull request #3223 from metalefty/x264-ci
x264: add CI test
2024-08-27 13:34:23 +09:00
Koichiro Iwao
2c2585cc90 GFX: use the preferred codec preferred in the config (H264 or RFX) 2024-08-27 11:46:52 +09:00
Koichiro Iwao
7238f8f99d Introduce XRDP_H264 macro to indicate any H264 encoder enabled 2024-08-27 11:46:52 +09:00
Koichiro Iwao
07e4e23c7b tconfig: add config which to prefer H264 vs RFX 2024-08-27 11:46:47 +09:00
matt335672
8f21f43768
Merge pull request #3198 from matt335672/add_pointer_guards
Add guards to xrdp_mm_module_cleanup
2024-08-26 16:06:38 +01:00
metalefty
5029bd12cd
Merge pull request #3221 from metalefty/x264-param
tconfig: fix setting default value and refine logging
2024-08-25 01:23:53 +09:00
Koichiro Iwao
72ede776ed x264: add CI test 2024-08-24 22:30:30 +09:00
Koichiro Iwao
b9d593bc11 tconfig: refine logging 2024-08-24 12:43:58 +09:00
Koichiro Iwao
16ef3dc3a8 tconfig: set proper default value for fps_den 2024-08-24 00:07:11 +09:00
metalefty
854d060917
Merge pull request #3214 from metalefty/x264-params
GFX: configurable x264 parameters
2024-08-23 14:24:41 +09:00
Koichiro Iwao
6aeb364c8d x264: Update x264 encoding parameters 2024-08-23 14:01:19 +09:00
Koichiro Iwao
010b6a3dbf x264: apply encoding parameters per connection type 2024-08-23 10:41:04 +09:00
Koichiro Iwao
d50c2fd4e4 tconfig: Makefile changes 2024-08-23 10:40:58 +09:00
Koichiro Iwao
b3513ba8df tconfig: add new toml config parser for gfx.toml 2024-08-23 10:40:44 +09:00
matt335672
2ebe6d1b6c
Merge pull request #3209 from matt335672/fix_bad_cache_message
Fix misreported cache size
2024-08-19 09:23:41 +01:00
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
413c8c833d Add guards to xrdp_mm_module_cleanup
Adds pointer checks to less commonly used codepaths to prevent
a possible SEGV on process shutdown.
2024-08-06 13:05:14 +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