Commit Graph

113 Commits

Author SHA1 Message Date
firewave 214cf50df5 fixed some unreadVariable Cppcheck warnings 2026-03-03 16:33:51 +01:00
firewave 67c11f0443 mitigated -Wdocumentation and -Wdocumentation-unknown-command Clang compiler warnings 2025-11-04 13:40:33 +01:00
matt335672 436a61e854 Correct sense of test
issue with 2a022ad681 uncovered
during Wayland testing on Trixie
2025-08-26 12:25:27 +01:00
matt335672 2a022ad681 Fix Coverity regression
Fix Coverity regression introduced by 0ff175c85e
2025-08-26 10:20:26 +01:00
matt335672 0ff175c85e Add support for forwarded resize request to VNC module
This feature was added to the RFB community wiki on 2020-12-22. See
commit a6dab64825b2ce4e9b47b8c9541619b94b7d908b in the rfbproto
repository
2025-08-22 12:29:20 +01:00
matt335672 51cc4f50a2 Fix VNC backend regression
Fix a regression introduced in v0.10.x, where it became impossible to
connect to a VNC server which did not support the ExtendedDesktopSize
encoding.

(cherry picked from commit 6b25bdb7db487ff73152643815d55977d7a7efda)
2025-08-05 10:06:31 +01:00
matt335672 3425ab6166 Add optional fd parameter to mod_connect() method
The fd parameter can be used to immediately connect to a display
server, if an fd was obtained from sesman
2025-07-14 19:39:26 +01:00
matt335672 4b2155b6cf Restructure VNC lib_mod_connect()
1) Restructure lib_mod_connect() along the lines of the PDUs documented
   in RFC 6143.
2) Logging in lib_mod_connect() has been revised and improved.
3) Wrinkles around version 3.7 and 3.8 of the RFB protocol are
   now addressed.
4) Some new definitions are added to rfb.h to replace the use
   of magic numbers.
2025-03-17 18:39:36 +00:00
Jesse Bakker 527d21b0a1 Add support for RFB protocol version 3.7 and 3.8
(cherry picked from commit 69cb53266f5b2536e22a4ece7a5eacb6e5ec69d9)
2025-03-15 09:49:37 +00:00
matt335672 39a178902e Improve logging on failed connect attempt 2025-03-08 11:45:26 +00:00
matt335672 6979df55ee Add new session type SCP_SESSION_TYPE_XVNC_UDS
This PR adds a new session type, which is a VNC session using a
Unix Domain Socket connection rather than a TCP connection.

This is necessary for FIPS_based deployments using VNC, as the classic
VNC password algorithm is not supported by FIPS
2025-03-08 11:45:26 +00:00
matt335672 b7a94bdb0a Coverity CID 468157 2025-02-03 15:32:55 +00:00
matt335672 984b71449e Regression: Support fixed-size VNC sessions
This is a regression introduced in v0.10.x

This version introduced a state machine to handle resizes requested
by the client and the server. Most configurations support resizeable
sessions, but one that doesn't is xrdp connecting to x11vnc on (e.g.) a
Raspberry PI.

If the session size requested by a client is differnt from the x11vnc
size, an error is logged and the state machine fails to complete,
resulting in a black screen.

This PR handles the problem by queueing a resize to the supported
server size and then continuing with the state machine. It's not an
optimal solution, but involves the least change to v0.10.x code.
2024-09-09 15:07:31 +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
firewave 5db94568ec vnc/vnc.c: fixed -Wmaybe-uninitialized warnings
vnc.c: In function ‘lib_framebuffer_update’:
vnc.c:816:37: error: ‘b’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  816 |         return (r << 16) | (g << 8) | b;
      |                ~~~~~~~~~~~~~~~~~~~~~^~~
vnc.c:1301:9: note: ‘b’ was declared here
 1301 |     int b;
      |         ^
vnc.c:816:31: error: ‘g’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  816 |         return (r << 16) | (g << 8) | b;
      |                            ~~~^~~~~
vnc.c:1300:9: note: ‘g’ was declared here
 1300 |     int g;
      |         ^
vnc.c:816:19: error: ‘r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  816 |         return (r << 16) | (g << 8) | b;
      |                ~~~^~~~~~
vnc.c:1299:9: note: ‘r’ was declared here
 1299 |     int r;
      |         ^
2024-04-23 18:38:20 +02:00
firewave fb9c175b11 enabled and fixed -Wmissing-prototypes compiler warnings
Co-authored-by: matt335672 <30179339+matt335672@users.noreply.github.com>
2024-04-23 18:38:20 +02:00
matt335672 e27c634970 Update VNC module resize functionality
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.
2024-02-15 16:48:13 +00:00
matt335672 689269dcde Fixes some problems with monitor hotplug
This fixes some monitor hotplug issues with non-GFX codepaths.

1) The server_version_message() was working on an out-of-date
   copy of the client_info. As a result, the X server and the
   window manager did not agree on the number of windows
2) As a result of 1), a memory leak was found in the VNC module.
2024-02-15 16:47:15 +00:00
matt335672 54acca43cf Resize state machine: A fix and a question (#2929)
* Store EGFX state before entering resize state machine

At present the EGFX state is destroyed by states WMRZ_EGFX_DELETE_SURFACE
through WRMZ_EGFX_DELETE. This means that at WMRZ_EGFX_INITIALIZE we
cannot distinguish between EGFX not being ever used, and EGFX
having been torn down. Consequently, when running non-GFX, we don't
correctly recover the session.

* Allow multiple reasons for suppress_output

Replaces the single boolean for suppress_output with
a bitmask, to allow output to be suppressed for
more than one reason

* Disable output during resize

* Add states to dynamic resize

Adds states to the dynamic resize state machine so we wait for a
Deactivation-Reactivation sequence to finish before sending pointer
updates, etc.

* suppress module output during the dynamic resize

* Add support for dynamic resize to VNC backend

xrdp_mm needs to be informed when a resize has been performed so that
the resize stte machine can be updsate.
2024-01-31 19:08:29 -05:00
matt335672 c52a173db0 Use symbolic constants in the modules for WM events 2023-11-27 15:42:24 +00:00
Koichiro IWAO 2b0c903afe vnc: add mouse button 6, 7, 8 support 2022-11-14 22:23:29 +09:00
Koichiro IWAO 70bc5ea092 vnc: Constify existing use of magic numbers 2022-11-14 22:23:29 +09:00
a1346054 7fe18cc1c0 fix typos 2022-09-03 02:01:48 +00:00
Christopher Pitstick bd9147d18f Updating to refactor xrdp_client_info
- Eliminate duplicaiton for display_size_description
- monitorCount needs to be uint32_t
- width/height -> session_width/session_height
- Update CLIENT_INFO_CURRENT_VERSION
- Also some misc unit test updates.
- Minor log updates.
2022-03-27 16:38:32 -04:00
matt335672 d02059d967 Add missing ssl_sha1_clear()/ssl_md5_clear() calls 2022-01-20 16:43:00 +00:00
matt335672 ab0e141fa9 Merge pull request #2011 from matt335672/unify_scpv0_code
Unify scpv0 code #2011
2022-01-05 11:06:42 +00:00
matt335672 67bf23feee Fix gcc11.1 uninitialised var warning 2022-01-04 10:09:33 +00:00
matt335672 8b9b22c773 Create shared GUID module to simplify session guid handling 2021-11-25 13:29:55 +00:00
matt335672 b0f3b13cff Fix minor memory leaks 2021-10-11 19:30:47 +01:00
matt335672 fe28af93e8 Split up vnc.c into modules and re-implement clipboard functions 2021-06-08 14:11:17 +01:00
Christopher Pitstick deb66ce766 Resolution switching without reconnecting.
- Based on https://github.com/jsorg71/xrdp/tree/dynamic_monitor
- Tested with xorgxrdp
- Tested with vnc
- Only works with single monitor.
- Update documentation to clarify the difference between MSTSC and
Microsoft Remote Desktop.
- Does not include compatibility with /gfx at this time, which is still
in testing.
- Updates to include ms-rdpedisp.h header for the 2.2.2 specification of
the protocol.
- Adds new dynamic_monitor_layout struct that shares the number of
monitors with xrdp_client_info.h
- Does not allow for BPP changes because the RDP protocol doesn't
support it.
- Option to disable feature as NeutrinoRDP doesn't support it (It was
based on FreeRDP 1.0.1 which didn't yet have this feature.)
- Add CLIENT_MONITOR_DATA_MAXIMUM_MONITORS constant and reference
spec definition.

Depends on https://github.com/neutrinolabs/xorgxrdp/pull/183
2021-04-22 01:34:03 -04:00
aquesnel def72ac4be Unify logging in vnc/* (#1811)
* Migrating logging to LOG() and LOG_DEVEL() in vnc/* (#1811)
2021-03-01 10:11:11 +00:00
matt335672 0a1a8f40e5 Moved a lot of string funcs to string_calls module 2020-12-22 11:57:24 +00:00
Matt Burt 1f8bb57fd6 Improve source_info commenting and fix neutrino slow link 2020-10-20 09:55:17 +01:00
matt335672 3c4b42b1aa Implemented resize and multimon support for VNC backend 2020-06-04 15:10:35 +01:00
Jay Sorg 4cbf84d99b vnc: implement suppress output 2019-04-25 14:54:25 -07:00
Pavel Roskin 6ed4c969f4 Eliminate APP_CC and DEFAULT_CC 2017-03-14 00:21:48 -07:00
Pavel Roskin b2d3dcf169 Include config_ac.h from all source files 2017-03-04 00:52:34 -08:00
Pavel Roskin b8ed23daab Constify the value argument to mod_set_param 2017-01-11 11:59:11 -08:00
volth 37b4a14b54 fix build with --enable-xrdpdebug=yes 2017-01-04 13:00:01 +00:00
Pavel Roskin a8fcbf8c2d Fix support for 32-bpp clients connecting to 16-bpp VNC 2016-12-09 08:43:07 -08:00
Jay Sorg 9a517b34f0 vnc: code cleanup 2016-12-04 15:39:10 -08:00
Jay Sorg 57905d71ad vnc: change password file to use guid hash 2016-12-03 23:12:48 -08:00
Pavel Roskin ace7d2c822 Declare unified module interface and use it in modules
This fixes loading modules compiled with a C++ compiler. Remote thandle
type, it's unused. Use tintptr for module data. Don't cast pointers to
long, they won't fit on Win64.
2016-07-08 05:09:09 +00:00
Pavel Roskin d1efb0d5ba Fix signed to unsigned comparisons reported by g++ 6.1.0 2016-07-08 04:29:51 +00:00
Pavel Roskin aeeb3d2c2e Fix warnings detected by -Wwrite-strings 2016-07-08 04:29:42 +00:00
Pavel Roskin 77b380c0b5 Fix format warnings in log_message() calls 2016-06-21 16:30:16 -07:00
Pavel Roskin 92a6833e9b Fix typos 2016-02-13 20:41:07 -08:00
Pavel Roskin a91a285734 vnc: enable 32 bpp support for Xvnc, it actually works 2016-02-10 09:30:23 -08:00
Pavel Roskin 2a5d204baa Don't capitalize "Error" and print the error value 2016-02-07 23:15:54 -08:00