4663 Commits

Author SHA1 Message Date
matt335672
3108a85e86 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.

(cherry picked from commit cc4a4c95f206697833082dc099b26dbd8102e170)
2024-07-30 10:46:03 +09:00
Koichiro Iwao
4d4ecdcaa4 GFX: selectable lossy compression levels
(cherry picked from commit e3c83c544c869fc8227d26d1626b81d38fa21576)
2024-07-30 10:45:41 +09:00
matt335672
da34d1e69d
Merge pull request #3175 from matt335672/v0_10_fix_potential_name_overflow
[V0.10] Fix potential name buffer overflows in redirector
2024-07-24 12:11:28 +01:00
matt335672
5223672437 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.

(cherry picked from commit c9e84dc16ced157fed9cb0f7d3bcc19782fb8551)
2024-07-23 12:29:43 +01:00
matt335672
2938c3d7b3
Merge pull request #3171 from matt335672/v0_10_fix_missing_pre_session_ipaddr
[V0.10] sesman: Copy IP address to pre_session_item struct
2024-07-22 09:46:30 +01:00
matt335672
4a90879555 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.

(cherry picked from commit a4f57572e65f97b2ea9ca748b5ad2762913b4703)
2024-07-19 12:01:47 +01:00
metalefty
a7d583a46d
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
d6fce2f173
Merge pull request #3152 from metalefty/v0.10-submodule
[v0.10] Support screens larger than 4096 pixels (update submodule)
2024-07-09 11:48:14 +09:00
Koichiro Iwao
2546bfa842 Support screens larger than 4096 pixels (update submodule)
Fixes:  #3083
2024-07-09 08:15:37 +09:00
metalefty
1d30c81323
Merge pull request #3150 from metalefty/v0.10-makedist
docs: always include docs/man/xrdp-mkfv1.8.in to dist tarball
2024-07-08 21:27:08 +09:00
Koichiro Iwao
e83dcc52eb 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
2024-07-08 16:34:23 +09:00
matt335672
61b509f1d5 Enforce no login screen if require_credentials is set
If the setting require_credentials is true, there should be no way
for the user to get to a login screen.

This commit makes the following changes if this flag is active:-
- Makes the checks around TS_INFO_PACKET more explicit.
- Closes the connection if the first login attempt fails.

(cherry picked from commit 8ac2f6db34649a93d3c9c4fe8fda61203702e615)
2024-06-27 11:55:26 +01:00
matt335672
8ddbe77e7c
Merge pull request #3127 from matt335672/v0_10_investigate_gfx_min_max_issue
[v0.10] Fix min/max monitor placing issue
2024-06-21 09:49:39 +01:00
matt335672
029059ef3d Fix min/max monitor placing issue
when a multi-monitor session has the top-left vertex of the primary
monitor at a desktop location other than (0,0), minimising and maximising
the session results in the (0,0) co-ordinate of the entire desktop being
placed at the top-left of the primary monitor.

The implementation seems to be at odds with [MS-RDPEGFX] 2.2.2.14 which
suggests the monitorDefArray of the RDPGFX_RESET_GRAPHICS_PDU should be
the same as that in the Monitor Layout PDU ([MS-RDPBCGR] 2.2.12.1)

(cherry picked from commit 095f0d0e4cd2589bcd6ab995a1f4c29c7fbc3d33)
2024-06-19 09:12:19 +01:00
matt335672
9a21e37f1f
Merge pull request #3122 from matt335672/v0_10_fix_server_24bpp_gfx
[v0.10] Don't use GFX if server max_bpp is <32
2024-06-19 09:02:55 +01:00
metalefty
0aa3a679c3
Merge pull request #3120 from metalefty/v0.10-libreoffice-image-clipboard
clipboard: fix a bug when pasting image to LibreOffice
2024-06-18 18:23:44 +09:00
Koichiro Iwao
e070902310
clipboard: tidy up bmp file header assembly
Sponsored by:   Krämer Pferdesport GmbH & Co KG
2024-06-18 11:13:40 +09:00
matt335672
90ca82fe52 Don't use GFX if server max_bpp is <32
(cherry picked from commit d2bab53364e179203af0fd6bbbac936269760661)
2024-06-17 13:24:26 +01:00
Koichiro Iwao
4968a34cd6
clipboard: fix a bug when pasting image to LibreOffice
While here, embed correct file size in BMP file header.

Fixes:          #3102
Sponsored by:   Krämer Pferdesport GmbH & Co KG
2024-06-17 21:08:30 +09:00
metalefty
7aa2b34ca0
Merge pull request #3088 from matt335672/v0_10_cherry_picks
Further cherry-picks for v0.10
2024-06-17 21:07:34 +09:00
matt335672
2319f56268 Replace 'dvorak' keyboard description with 'us(dvorak)'
In the words of @iskunk

It is no longer possible to refer to the Dvorak layout as just "dvorak"
(as when one would run "setxkbmap dvorak"); one must now use either
"us dvorak" or "us(dvorak)"

See https://bugs.debian.org/1063725

(cherry picked from commit a1b7c1790651dc3fef5ac43657620a670e2e68af)
2024-06-12 14:09:31 +01:00
matt335672
a5ec4a3817 Add explicit object for the encoder finishing
On a resize, the encoder is deleted. At present this is done by asking
the encoder to exit, and then waiting a second.

- On slower systems, a second may not be enough, and so the encoder
  data structures are freed while they are still being used by the
  encoder.
- On quicker systems, resizes are delayed by hundreds of milliseconds
  longer than they need to be.

This commit adds a wait object which the encoder can use to signal it
has actually finished.

(cherry picked from commit 985b0de35e84ae5e7e46bd1a2b2e9fa1e31e53c0)
2024-06-10 18:54:26 +01:00
matt335672
a430eb93cb Prevent SEGV when resizing with GFX
The xrdp_enc_data contains a union for handling surface commands
and gfx commands. Memory processing is different for these two
options.

The default destructor for the encoder FIFO only knows about surface
commands. Consequently, if the encoder has queued GFX data when the
encoder is closed, the destructor processes the queued data as if
it contained surface commands rather than GFX commands. This typically
causes a SEGV as the drects field of the overlaid surface command
structure is not pointing at anything valid when it is freed.

(cherry picked from commit 809df89c0869e6c595c19ef6b4b1d2cbfab802ff)
2024-06-10 18:54:18 +01:00
matt335672
0bef23f217 Fix session list processing
The get_sorted_session_displays() is broken in that it
doesn't produce a sorted list of displays.

The problem is the qsort comparison function which has 2 errors in 4 lines:-
1) The test is the wrong way round (i.e. arg1 < arg2 produces a +ve
   result instead of -ve)
2) Subtracting two unsigned ints in C will never return < 0

The broken function has been masked by other display checks which mean
that it is only visible in a few situations:-
1) Starting two sessions very closely to each other may allocate the
   same display to both sessions.
2) If /tmp is namespaced, the other display checks do not work, and
   more than two sessions cannot be started.

(cherry picked from commit 70f1b685ba6a93dc3eb5f7537d933430097d6a61)
2024-06-03 09:46:31 +01:00
matt335672
c32180ce5b Bump FreeBSD CI version to 13.3
(cherry picked from commit cbaaf221cde9945a79de36b09e2e9bb70a847131)
2024-06-01 10:35:17 +01:00
Schen
84901958a5 Fix a systemd dependency ("network-online.target")
- Fix a problem that the xrdp.service fail to auto-start when instructed to listen on a specific interface
- By changing the "network.target" systemd dependency to "network-online.target"
- The "network-online.target", in short, means at least one network interface has finished IP level setup.
- The previously used "network.target" is vague and does not provide such guarantee (ref: man systemd.special(7)).
- Which often cause "xrdp.service" fail to auto-start when the service is configured to listen on a specific interface (e.g. in xrdp.ini, "port=tcp://192.168.0.1:3389"). Because the interface may have not finish setting up its IP, when "xrdp.service" starts.

(cherry picked from commit 21e11de15762a7cfb65083c2b9a19a197587dae8)
2024-05-23 11:41:59 +01:00
matt335672
dcaa31ef16 chansrv FUSE fixes
1) [Regression] If the specified mountpoint is not immediately below an
   existing directory, the directory is not created.
2) The message to ask the user to unmount an existing mounted directory
   has been moved to the right place.

(cherry picked from commit e0a1339b34b0d235e93efaf2c512c7284548d20b)
2024-05-22 09:55:01 +01:00
metalefty
763c1c5855
Merge pull request #3069 from metalefty/v0.10-release
Release v0.10.0
v0.10.0
2024-05-10 23:11:16 +09:00
Koichiro Iwao
0872f9378f Bump version to 0.10.0 2024-05-10 22:40:01 +09:00
Koichiro Iwao
53e13abef1 Update NEWS 2024-05-10 22:40:01 +09:00
metalefty
8c614cdf9c
Merge pull request #3068 from metalefty/v0.10-update-news
Turn off cache explicitly when fetching NEWS from wiki
2024-05-10 17:58:22 +09:00
Koichiro Iwao
dad7766afc Turn off cache explicitly when fetching NEWS from wiki 2024-05-10 17:36:32 +09:00
metalefty
cc35ac63c9
Merge pull request #3034 from metalefty/v0.10-release
Release v0.10.0-beta.3
v0.10.0-beta.3
2024-04-19 23:43:44 +09:00
Koichiro Iwao
7ea81186c6 Add script to update NEWS from wiki 2024-04-19 11:57:51 +09:00
Koichiro Iwao
3329f60318 Bump version to v0.10.0-beta.3 2024-04-19 11:57:51 +09:00
Koichiro Iwao
492f8b5cf7 Update NEWS
It is still a beta release at the moment so release date is not
determined.
2024-04-19 11:57:47 +09:00
matt335672
0a7e556d7d
Merge pull request #3032 from matt335672/v0_10_update_rfxcodec
[V0.10] Merge updates from librfxcodec
2024-04-18 16:35:34 +01:00
matt335672
cb50f18da9 Merge updates from librfxcodec
1) add SSE2 simd for dwt_shift_rem and diff_count

   make dwt_shift_rem easier to read
   move common rlgr defines to common file
   move common dwt defines to common file

2) Fix 'make distcheck'

3) Fix compiler warnings on tests
2024-04-18 15:47:40 +01:00
matt335672
b45630e879
Merge pull request #3017 from matt335672/cherry_picks_to_v0_10
Cherry picks to v0 10
2024-04-15 20:37:47 +01:00
Jay Sorg
dfa52c1183 format change
(cherry picked from commit 898e1ca135922172698a70b0a267d67aa1958c10)
2024-04-15 19:26:48 +01:00
Jay Sorg
7030a74ab9 gfx send multiple wire to surface messages when compressed data is larger than max_compressed_bytes
(cherry picked from commit 95bfb349a8833ea51c1932df6e4c17445131e61c)
2024-04-15 19:26:35 +01:00
matt335672
f688e680c9 Simplify allowed system calls for xrdp
- The command 'systemd-analyze syscall-filter' shows that the group
  @system-service added to the xrdp-service SystemCallFilter
  actually includes all of the other listed groups and individual
  services.  Consequently this line can be simplified to just specify
  @system-service.

- (reversion) The SystemCallErrorNumber setting in xrdp.service has been
  removed so that unauthorized system calls cause an immediate process exit.

(cherry picked from commit e0e9177f5ede99096ec37072d01ea625c939d805)
2024-04-12 11:16:37 +01:00
matt335672
252243ab6c Fix permissions on user socket directory
The user socket directory needs to be SGID so that they inherit
the group ownnership. Then xrdp can write to them.

(cherry picked from commit 200e4d84f44fd44d332915c5ca55d59092d8dc31)
2024-03-27 09:50:27 +00:00
Jay Sorg
9dbe504878 remove per frame log entry when client frame acks is off
(cherry picked from commit 651fcf85b7c31502eb4800b6cd43840f2944509a)
2024-03-27 09:49:57 +00:00
matt335672
02dc01d31e Remove hard-coded version from scripts/run_astyle.sh
This script now works the same way as cppcheck. The version to
be used is specified once in the github CI action

(cherry picked from commit b9fd19e6b50dbcc28be1129f5e35714a0522fc9b)
2024-03-27 09:49:24 +00:00
matt335672
2ee512ba52 Remove unnecessary '-lrt' from common lib link
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.

(cherry picked from commit e821eddb62c5dc4872922e9244d2e407e0361b57)
2024-03-27 09:48:53 +00:00
matt335672
40b0eaf455 Improve performance on long fat networks (LFNs)
On Linux, the TCP send buffer size is increased to 32768 if it is less
that this (which it normally is). This however has the effect of disabling
dynamic buffer sizing, leading to a maximum available bandwidth of

max_bandwidth = 262144 (bits) / round_trip_time (secs)

This is not noticeable on a LAN with an RTT of around 0.5ms, but
very noticeable on a WAN with an RTT of 0.25s.

Comments in the config file and manpage in this area are improved, as
is the logging if the parameters are actually set.

(cherry picked from commit b23d6f89d5512bef68ab1d07fd84f25b44b99e6d)
2024-03-27 09:48:16 +00:00
metalefty
fc34c2b4c8
Merge pull request #3007 from metalefty/v0.10-release
Bump version to v0.10.0-beta.2
v0.10.0-beta.2
2024-03-20 23:13:14 +09:00
Koichiro Iwao
a48ea06e9b Bump version to v0.10.0-beta.2 2024-03-20 23:12:25 +09:00
metalefty
04da549942
Merge pull request #3003 from matt335672/v0_10_detect_missing_drdynvc
[V0.10] detect missing drdynvc
2024-03-17 22:50:31 +09:00