Commit Graph

4765 Commits

Author SHA1 Message Date
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 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
matt335672 2446c206e6 xrdp: PID file handling tidy-ups
Now we have g_file_open_rw() we don't need to try to write to
the PID file to see if we can. Just leave the file open and write to
it after forking.
2024-07-01 11:11:21 +01:00
matt335672 ddff9ebb32 Refactor xrdp_listen to allow for privilege drop
- xrdp_listen.c is refactored so we can create the
  listening socket(s) before dropping privileges.
- The code which reads startup params from xrdp.ini
  is moved from xrdp_listen.c to xrdp.c, so it
  is only called once if we test the listen before
  starting the daemon.
2024-07-01 11:11:21 +01:00
matt335672 17a56567d2 Add params to allow xrdp to be run as non-root
runtime_user and runtime_group are added to the xrdp.ini file
so that the service knows how to reduce privilege
2024-07-01 11:11:21 +01:00
matt335672 8ac2f6db34 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.
2024-06-27 11:53:52 +01:00
matt335672 1d927add29
Merge pull request #3111 from matt335672/investigate_gfx_min_max_issue
Fix min/max monitor placing issue
2024-06-19 09:13:40 +01:00
matt335672 c92334720c
Merge pull request #3121 from matt335672/fix_server_24bpp_gfx
Don't use GFX if server max_bpp is <32
2024-06-19 09:00:05 +01:00
metalefty faed0d538c
Merge pull request #3123 from metalefty/libreoffice-clipboard
Forward #3102 to devel
2024-06-18 23:21:39 +09:00
Koichiro Iwao a6199e8510
clipboard: tidy up bmp file header assembly
Sponsored by:   Krämer Pferdesport GmbH & Co KG

(cherry picked from commit e070902310)
2024-06-18 21:56:30 +09:00
Koichiro Iwao 57cf5c19b7
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

(cherry picked from commit 4968a34cd6)
2024-06-18 21:56:19 +09:00
matt335672 d2bab53364 Don't use GFX if server max_bpp is <32 2024-06-17 11:53:47 +01:00
matt335672 8ee4a6cb6f
Merge pull request #3113 from matt335672/fix_evdev_keycode_problems
Fix evdev keycode problems
2024-06-14 10:23:29 +01:00
matt335672 620f3b6220 Pass KBDFLAGS_EXTENDED1 flag for FP scancode events
The current fastpath code for scancode events is not mapping
the FASTPATH_INPUT_KBDFLAGS_EXTENDED1 flag to the KBDFLAGS_EXTENDED1
flag.
2024-06-12 16:20:12 +01:00
matt335672 96168ff918 Fix lookup of extended keys
6257dae74d added a mapping of RDP
scancodes to X11 keycodes to the XUP interface. The intention is
to move this functionality from xorgxrdp to a common lookup
in xrdp.

The mapping of RDP scancodes for extended keys (e.g. Right-CTRL) is
not being done correctly.
2024-06-12 16:16:47 +01:00
matt335672 a5a7ccc660
Merge pull request #3112 from matt335672/fix_dvorak_layout
Replace 'dvorak' keyboard description with 'us(dvorak)'
2024-06-12 14:08:02 +01:00
matt335672 a1b7c17906 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
2024-06-12 10:46:32 +01:00
matt335672 095f0d0e4c 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)
2024-06-10 20:01:56 +01:00
matt335672 6fa941e208
Merge pull request #3107 from matt335672/fix_resize_crash
Fix GFX resize crash
2024-06-10 18:50:09 +01:00
matt335672 985b0de35e 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.
2024-06-03 16:00:31 +01:00
matt335672 809df89c08 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.
2024-06-03 15:50:16 +01:00
matt335672 8048a63b49
Merge pull request #3106 from matt335672/fix_link_error_on_devel_all
Fix build with devel logging, but without --enable-pixman
2024-06-03 13:33:42 +01:00
matt335672 f38e215de5 Fix build with devel logging, but without --enable-pixman
If ./configure is used with devel logging, but without --enable-pixman,
the stub pixman development files are used.

However, in this configuration, the pixman_region_selfcheck() function
is declared, but not defined.

This is a regression introduced in 7e58209b19
2024-06-03 11:46:08 +01:00
matt335672 c98289732e
Merge pull request #3103 from matt335672/fix_display_list
Fix session list processing
2024-06-03 09:42:28 +01:00
matt335672 5c4278ccb1
Merge pull request #3090 from matt335672/remove_ibus_daemon_delay
Remove the wait for the ibus daemon to start
2024-06-01 10:41:19 +01:00
matt335672 70f1b685ba 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.
2024-06-01 10:31:58 +01:00
matt335672 c47a87e8e6
Merge pull request #3104 from matt335672/freebsd_13_3
Bump FreeBSD CI version to 13.3
2024-06-01 10:31:18 +01:00
matt335672 cbaaf221cd Bump FreeBSD CI version to 13.3 2024-06-01 10:20:03 +01:00
matt335672 5f91eec695 Remove duplicate enable&disable func registration 2024-05-30 12:19:20 +01:00
jsorg71 00332aca17
Merge pull request #3073 from jsorg71/x264
add GFX h264 software via --enable-x264
2024-05-28 11:18:57 -07:00
Jay Sorg 4dcf59c8f4 remove some unnecessary code 2024-05-28 10:57:55 -07:00
Jay Sorg 2bed4f6b9b rename old_capture_code to mark unused 2024-05-28 10:57:55 -07:00
Jay Sorg 485e64ee76 fix for odd width, height 2024-05-28 10:57:55 -07:00
Jay Sorg 112a534f4c change capture_code to enum 2024-05-28 10:57:55 -07:00
Jay Sorg 96ff6fdba8 multimon fixes 2024-05-28 10:57:55 -07:00
Jay Sorg 57ed8e9d52 format 2024-05-28 10:57:55 -07:00
Jay Sorg b583a8d510 xrdp_encoder.c changes for x264 2024-05-28 10:57:55 -07:00
Jay Sorg ab97002c22 add xrdp_encoder_x264.c/h 2024-05-28 10:57:55 -07:00
Jay Sorg e5e56a2ed9 add x264 to configure.ac 2024-05-28 10:57:55 -07:00