Commit Graph

996 Commits

Author SHA1 Message Date
matt335672
6500949a18 Fix message ordering in devredir
The drive redirector is not compliant with the message ordering
in [MS-RDPEFS], causing FreeRDP 2.11.2 ro fail on redirecting drives.
2023-10-26 15:19:09 +01:00
firewave
90c7e72656 provide more includes to Cppcheck
- added (temporary) suppression of Cppcheck `shiftTooManyBits` false positives in `libxrdp/xrdp_mppc_enc.c`
- fix Cppcheck `nullPointerRedundantCheck` in `sesman/chansrv/clipboard.c`
2023-10-18 10:14:06 +01:00
Koichiro Iwao
37f206d2c8 Cherry-pick downstream patch from EPEL
Same as #2715

Obtained from: https://src.fedoraproject.org/rpms/xrdp/blob/014fe42/f/xrdp-0.9.22.1-no-c99.patch
2023-10-12 14:27:39 +09:00
matt335672
f6fa3fc5ba Remove client-server shortcut paste code
When significant amounts of data is coming from the client in a
fragmented CLIPRDR_DATA_RESPONSE PDU, this code provides a way to
start copying it to a requesting client before it is all read.

The only advantage of this code is to provide a slight speedup
before a paste is visible on the server.

There are significant problems with this code. Notably, it is
very difficult to parse Unicode text coming through this route. Each
UTF-16 character can occupy up to 4 bytes, and a fragmentation
boundary could occur at any point within a UTF-16 character.
2023-10-11 10:41:34 +01:00
matt335672
e6bc4db423 access_login_allowed: Remove primary group check
This check is now performed within g_check_user_in_group()
2023-10-06 10:56:14 +01:00
matt335672
322d11b431 [v0.9] Check auth_start_session() result 2023-08-19 13:26:44 +01:00
matt335672
722fe7d74f clipboard: Fix TODO action in clipboard_common.h
Use the official Windows clipboard format names where appropriate

Replace g_file_format_id with g_file_group_descriptor_format_id
as the latter name is more descriptive of what is described in
[MS-ECLIP]
2023-08-08 09:46:20 +01:00
matt335672
15f730524e clipboard: Only advertise text to X11 clients if it is available 2023-08-08 09:46:13 +01:00
matt335672
680bba8a02 clipboard: Tell the X11 client if a selection is unavailable 2023-08-08 09:46:05 +01:00
matt335672
7e514bf339 Bump cppcheck to v2.11
This fixes the following errors:-

sesman/tools/authtest.c:64:14: error: syntax error [syntaxError]
    g_printf("xrdp auth module tester v" PACKAGE_VERSION "\n");
             ^
sesman/tools/sesrun.c:165:14: error: syntax error [syntaxError]
    g_printf("xrdp session starter v" PACKAGE_VERSION "\n");
             ^
vrplayer/decoder.h:35:12: error: There is an unknown macro here somewhere. Configuration is required. If slots is a macro then please configure it. [unknownMacro]
    public slots:
           ^
vrplayer/playaudio.h:45:12: error: There is an unknown macro here somewhere. Configuration is required. If slots is a macro then please configure it. [unknownMacro]
    public slots:
           ^
vrplayer/dlgabout.h:22:13: error: There is an unknown macro here somewhere. Configuration is required. If slots is a macro then please configure it. [unknownMacro]
    private slots:
            ^
vrplayer/playvideo.h:49:12: error: There is an unknown macro here somewhere. Configuration is required. If slots is a macro then please configure it. [unknownMacro]
    public slots:
           ^
Additionally, cppcheck now makes use of all available CPUs
2023-06-23 17:05:21 +01:00
matt335672
3d2b3b89f4 Remove size limit for PAM environment variables
The current logic in auth_set_env() for PAM environments only allows
environment variables to be around 256 characters in length.
2023-05-31 16:30:58 +01:00
matt335672
a58c895d1b Allow longer UserWindowManager strings
The UserWindowManager is limited to 31 characters. There appears
to be no good reason for this.
2023-05-02 12:06:30 +01:00
Lennart Sauerbeck
d4ea314ac2 sesman: Prevent the use of 'alternate shell'
By setting the new config value 'AllowAlternateShell' to 'no' it is now
possible to prevent the use of an alternate shell, which can be set by
the connecting user.
The default remains unchanged and any shell is allowed if the config
value is not specified. It can also be set explicitly to 'yes' to achieve
the same outcome.

Fixes: #850
2023-04-17 22:34:19 +02:00
Jay Sorg
bd63675a75 chansrv: don't free item on stack 2023-03-27 10:11:23 +01:00
Koichiro IWAO
f4e909c071 sesman: fix help message alignment 2023-03-08 13:07:33 +09:00
Zhipeng Xue
689950d953 Fix potential null dereference 2023-03-06 23:01:22 +09:00
Yifan J
44efa5db5b Make pam.d directory configurable 2023-02-27 10:49:08 +00:00
Koichiro IWAO
3080439fa9 chansrv/audin: return UNKNOWN when undefined value
is passed to audin_wave_format_tag_to_str.
2023-02-17 10:52:55 +09:00
Koichiro IWAO
2350267f49 chansrv/audin,sound: record index of formats array
It helps to know which audio format is in use.
2023-02-17 10:52:48 +09:00
Koichiro IWAO
cde22e3b4d chansrv/audin: record audin (microphone redirection) audio formats 2023-02-17 10:52:41 +09:00
Koichiro IWAO
b765304a43 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-17 10:52:34 +09:00
Koichiro IWAO
58921a972e chansrv: add a utility function to convert wFormatTag into string 2023-02-17 10:52:26 +09:00
Hiero32
46b4ee2e95 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-17 10:49:40 +09:00
matt335672
f31fee3052
Merge pull request #2508 from matt335672/v0_9_otaconix_patch_1
[V0.9] Tiny fix in pseudocode description of startwm.sh
2023-01-18 15:29:34 +00:00
otaconix
a80e66e2d2 Tiny fix in pseudocode description of startwm.sh
I realize there's not much value in this PR, but I noticed this, so I thought I'd fix it 🙂
2023-01-18 15:07:10 +00:00
matt335672
6aac2e942d 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-18 14:40:02 +00:00
matt335672
814d56317c Remove double '!' from test
Commit 7ad7b05261 introduced a regression
which prevented remote drives being accessible. I picked it up in testing,
but then failed to commit the change.
2022-12-09 18:12:25 +00:00
matt335672
fbf374c8b0
Merge pull request #2461 from metalefty/ci-fix
Fix CI failure after 8484767
2022-12-09 17:21:49 +00:00
metalefty
36c54d9776
Merge pull request #2460 from matt335672/v0_9_pcscd_sock_permissions
Set permissions on pcsc socket dir to owner only
2022-12-10 00:12:02 +09:00
Koichiro IWAO
2f1196bdc4 Fix CI failure after 8484767
libscp_v0.c:228:52: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
  228 |         if ((trans->in_s->end - trans->in_s->data) < trans->header_size)
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
2022-12-09 23:21:26 +09:00
metalefty
0418502eb3
Merge pull request from GHSA-3jmx-f6hv-95wg
CVE-2022-23480
2022-12-09 22:10:33 +09:00
matt335672
413678ef3d 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:57:46 +00:00
matt335672
191ed3e3fa 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-08 14:13:48 +00:00
matt335672
7ad7b05261 CVE-2022-23480
Added length checking to redirector response parsing
2022-12-08 10:36:40 +00:00
matt335672
d49f269af8 CVE-2022-23477
Prevent buffer overflow for oversized audio format from client
2022-12-08 10:26:08 +00:00
matt335672
4a8e5d3493 Clear password when session ends
Any password stored in SCP_SESSION is now cleared before storage
is returned to the heap
2022-11-28 10:44:09 +00:00
matt335672
56a7c3efdd Remove unnecessary data from struct t_auth_info
8fc5610dad back-ported to v0.9
2022-11-28 10:20:58 +00:00
a1346054
6acf8398dd fix typos
(cherry picked from commit 7fe18cc1c0)
2022-09-11 11:47:11 +09:00
a1346054
1a3a9bb479 remove executable bit from text files
(cherry picked from commit 5ff68740e5)
2022-09-11 10:50:43 +09:00
Khem Raj
d64be8a1cd 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>
(cherry picked from commit fc2d61e0c8)
2022-09-11 10:47:56 +09:00
Koichiro IWAO
44e9982119 sesman: fix spacing in log
[20220301-18:25:01] [INFO ] Starting window manager on display 12from user home directory: /home/user/startwm.sh
                                                                ^^

(cherry picked from commit 2c25e60abc)
2022-09-11 10:46:54 +09:00
Koichiro IWAO
c5e0e4962c sesman.ini: mention FreeBSD Xorg path 2022-08-26 14:11:17 +09:00
matt335672
87cbab2148 Open log in sesman before reading config 2022-05-19 09:18:41 +09:00
matt335672
8bd597a038 Fix signal handling in sesman 2022-03-04 11:37:45 +00:00
matt335672
2484928a5a Change 3rd parameter of log_start() to flags field 2022-03-04 11:37:45 +00:00
matt335672
fcd991844a sesman : Move global declarations to sesman.h 2022-03-03 17:01:55 +00:00
matt335672
b689707d15 Remove unnecessary log message 2022-02-16 11:59:56 +00:00
bin zhong
f8f18e27c5
Merge branch 'neutrinolabs:devel' into devel 2022-02-15 09:52:28 +08:00
zbstao
ff39ce719e Fixed possible infinite loop
Fixed possible infinite loop
2022-02-15 09:41:21 +08:00
matt335672
e1c6afa38e
Merge pull request #2144 from matt335672/remove_s_check
Remove s_check() macro
2022-02-14 09:00:21 +00:00