Commit Graph

491 Commits

Author SHA1 Message Date
matt335672
05d1733950 Change chansrv to use common fifo code 2023-05-22 14:43:22 +01:00
matt335672
8535f8e08c
Merge pull request #2675 from matt335672/fix_chansrv_signal_handling
Fix signal handling in chansrv.c
2023-05-22 10:03:02 +01:00
Daniel Richard G
1c0c923ad1 Split g_file_open() into _ro() and _rw() variants
Rename g_file_open() to g_file_open_rw(), and add a new g_file_open_ro()
call that wraps the common g_file_open_ex(file, 1, 0, 0, 0) idiom. This
will make the file access mode more explicit in the code.

Change all calls to g_file_open() to the _ro() or _rw() variant as
appropriate, and replace g_file_open_ex(file, 1, 0, 0, 0) with the _ro()
call.

Lastly, add tests for the two new calls to test_os_calls.c (code
courteously provided by matt335672).
2023-05-15 17:38:31 -04:00
matt335672
0a44594f51 Fix signal handling in chansrv.c
Signal handlers now only use signal-safe code

See signal-safety(7) on Linux
2023-05-15 14:16:29 +01:00
Daniel Richard G
42d32e7496 Use config_ac.h consistently and correctly 2023-05-12 13:49:53 -04:00
Jay Sorg
6628d57b55 chansrv: build fix, use libipm from build dir 2023-04-03 22:25:06 -07:00
matt335672
ea12231247 Updaste chansrv files related to new libsesman 2023-03-30 13:07:49 +01:00
matt335672
2f3693b3dc autotools changes related to new libsesman library 2023-03-29 14:31:30 +01:00
matt335672
177707dcb9
Merge pull request #2608 from Hiero32/Support-to-set-parameters-for-#2519
Support to set parameters for #2519
2023-03-29 10:29:23 +01:00
Hiero32
9fe9ae3bc0 Support to set parameters from sesman.ini. 2023-03-28 21:20:54 +09:00
matt335672
3ee8eb9c9e
Merge pull request #2592 from matt335672/restructure_session_start
Restructure session start
2023-03-27 10:38:37 +01:00
Jay Sorg
054c78d568 chansrv: don't free item on stack 2023-03-24 16:33:16 -07:00
matt335672
8b9f9b40c8 os_calls changes
- Add g_pipe()
- Add g_file_duplicate_on()
- Rework struct exit_status to make it easier to parse
- Add optional status return to g_waitchild()
2023-03-23 18:12:06 +00:00
Zhipeng Xue
fbb3b9cef9 Fix potential null dereference 2023-03-05 13:38:43 +08:00
matt335672
acdfd12cb6 Fix typo in chansrv_fuse.c
The code as it stands is checking two file descriptors for possible
input, but only one needs to be checked.
2023-02-13 14:28:29 +00:00
matt335672
78fa1c15b2 Replace select() system call with poll()
poll() is specified in POSIX.1-2001 as a simpler interface for
multiplexed file descriptors than select(). It also provides more
functionality.

This PR replaces the select() calls used in xrdp with poll()
equivalents.
2023-02-13 14:28:29 +00:00
metalefty
f3dc94448c
Merge pull request #2537 from metalefty/sound-log
sound: logging improvements
2023-02-13 10:38:31 +09:00
Koichiro IWAO
9d7a817e87 chansrv/audin: return UNKNOWN when undefined value
is passed to audin_wave_format_tag_to_str.
2023-02-11 11:51:08 +09:00
Hiero32
1ffe7890d8
sound: fix noise between two playbacks for mp3/aac (#2519)
* sound: fix noise between two playbacks for mp3/aac
* fix sound stuttered on skip operation of vlc
2023-02-09 10:09:04 +09:00
Koichiro IWAO
73a8865561 chansrv/audin,sound: record index of formats array
It helps to know which audio format is in use.
2023-02-09 01:21:45 +09:00
Koichiro IWAO
a355b7bf98 chansrv/audin: record audin (microphone redirection) audio formats 2023-02-09 01:06:44 +09:00
Koichiro IWAO
264ee4a761 chansrv/sound: adjust log level and record wFormatTag as string
These log levels are unintendedly decreased during logging reworking.

Recording audio formats are useful to know which format is used in
current RDP session.
2023-02-09 01:06:44 +09:00
Koichiro IWAO
5f07c648e4 chansrv: add a utility function to convert wFormatTag into string 2023-02-09 01:06:44 +09:00
matt335672
9e53b72c80
Merge pull request #2528 from akarl10/chansrv-fuse-display-variable
Add %d and %D to fuse mount path for local mounts.
2023-02-02 10:36:49 +00:00
akarl10
46398fcda5 [chansrv-fuse] refactoring to make compiler happier 2023-02-01 16:03:32 +01:00
Michael Saxl
2052664d69 [chansrv-fuse] do also % substitutions when relative paths are used 2023-01-31 20:11:26 +01:00
akarl10
3458210c1c [chansrv-fuse] Add %d and %D as path replacement variables
%d is the numeric display number
%D is the DISPLAY environment variable

this enables the concurrent use of fuse in multiple sessions of the same
user
2023-01-31 19:41:02 +01:00
matt335672
5ed9b96530 Add missing include guards 2023-01-31 09:30:36 +00:00
matt335672
5f030a95b7 Don't try to listen on the scard socket if it isn't there
If the scard local socket can't be created, there's no point
in trying to listen on it. This will just fill the chansrv log
file with errors.
2023-01-16 13:41:18 +00:00
metalefty
321f124c73
Merge pull request #2459 from matt335672/pcscd_sock_permissions
Set permissions on pcsc socket dir to owner only
2022-12-10 21:11:44 +09:00
matt335672
b5b047458e Remove unused g_full_name_for_filesystem
Not only was this unused, the way it was read could lead to a
buffer overflow (CVE-2022-23480)
2022-12-09 18:11:03 +00:00
matt335672
ae7c17e1f6 CVE-2022-23480
Added length checking to redirector response parsing
2022-12-09 18:11:03 +00:00
matt335672
96afae1ec5 CVE-2022-23477
Prevent buffer overflow for oversized audio format from client
2022-12-09 17:33:34 +00:00
matt335672
89c873e4aa Set permissions on pcsc socket dir to owner only
There is no reason for any user other than the current one to be able
to communicate with the remote smartcard.
2022-12-09 11:55:31 +00:00
Khem Raj
fc2d61e0c8 mark count with unused attribute
This may throw a warning with clang-15+ when devel logs are disabled
Fixes
../../../xrdp-0.9.19/sesman/chansrv/chansrv.c:198:9: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-09-05 22:58:07 -07:00
a1346054
5ff68740e5
remove executable bit from text files 2022-09-03 02:02:14 +00:00
a1346054
7fe18cc1c0
fix typos 2022-09-03 02:01:48 +00:00
matt335672
8f1bdaa95e Remove TCP socket support fron chansrv
The code in xrdp_mm.c to connect to chansrv over a TCP socket has
been removed, with the move to UDS. This PR simply removes the
chansrv TCP listening code. Without doing this, some configurations
result in a failure of xrdp to connect to chansrv.
2022-05-03 10:57:41 +01:00
matt335672
b689707d15 Remove unnecessary log message 2022-02-16 11:59:56 +00:00
matt335672
e6c098e750 Remove s_check() macro 2022-02-09 10:18:15 +00:00
matt335672
cffce1f856 Only advertise X11 clip formats we can supply 2022-01-14 11:11:03 +00:00
Kentaro Hayashi
1d6d80d14f Block inbound clipboard text/image/file respectively
Disable clipboard_event_selection_request call is overkill for
blocking text/image/file purpose.
For example, it breaks existing behavior (slow response from gedit,
gimp as a side effects)

Instead, in clipboard_event_selection_request, these media format will
be blocked respectively which depends on the following configurations
in sesman.ini [Security] section.

  * RestrictInboundClipboard=text
  * RestrictInboundClipboard=file
  * RestrictInboundClipboard=image

You can also set comma separated list.

  * RestrictInboundClipboard=text,file,image
2022-01-14 10:17:02 +09:00
Kentaro Hayashi
fb1c4ec945 Block outbound clipboard text/image/file respectively
RestrictOutboundClipboard kills all of test/file/image
transfer via clipboard.

For controlling each content type behavior,
clipboard_xevent is not appropriate place to block respectively.

Instead, in clipboard_event_selection_notify, these media type
will be blocked which depends on the following configurations in
sesman.ini [Security] section.

  * RestrictOutboundClipboard=text
  * RestrictOutboundClipboard=file
  * RestrictOutboundClipboard=image

You can also set comma separated list

  * RestrictOutboundClipboard=text, file, image
2022-01-14 10:17:02 +09:00
Kentaro Hayashi
bd82084505 Extend In/Outbound text,file,image restriction respectively
It supports the extended configurations for sesman.ini:

Before:

  [Security]
  RestrictOutboundClipboard=true or false

After:

  [Security]
  RestrictInboundClipboard=[true or false | text or file or image | comma separated list]
  RestrictOutboundClipboard=[true or false | text or file or image | comma separated list]

Above configuration is disabled by default (false)
And it can be specified comma separated list like this:.

  RestrictInboundClipboard=file, image
  RestrictOutboundClipboard=text, file, image

Note that if RestrictOutboundClipboard=true,file is set,
file is ignored and it is treated as RestrictOutboundClipboard=true

It is same for RestrictInboundClipboard.
2022-01-14 10:17:02 +09:00
Kentaro Hayashi
53027ad5af Use LOG instead of LOG_DEVEL
According to https://github.com/neutrinolabs/xrdp/wiki/Logging,
it may be better to emit this log message because this log is
useful for system administrator to know whether RestrictOutboundClipboard
configuration works or not

And raise log level to info because it is informative for system
administrator.
2021-12-23 12:58:35 +09:00
Kentaro Hayashi
23906383b6 clipboard: Fix wrong debug level log message for g_file_atom2
As g_file_atom2 is x-special/gnome-copied-files
(See g_file_atom2 definition in sesman/chansrv/clipboard.c),
it should be "x-special/gnome-copied-files" in this context.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
2021-12-06 12:40:41 +09:00
matt335672
a49144be73 Avoid deadlock in clipboard copy code 2021-10-25 16:16:59 +01:00
matt335672
b87b7f9ee8 Add xfuse_path_in_xfuse_fs() 2021-10-25 16:16:54 +01:00
matt335672
32d5d7cc27
Merge pull request #2001 from metalefty/clipfile-fail
clipboard file: Implement MS-RDPECLIP 3.1.5.4.7 compliance (#2001)
2021-09-21 10:37:35 +01:00
Koichiro IWAO
eb848747d2
clipboard file: adjust log level and add some detailed info 2021-09-21 18:19:47 +09:00