Commit Graph

4212 Commits

Author SHA1 Message Date
matt335672
1d190c6ea8 Prevent unnecessary close of sck = -1 in trans_listen_address() 2022-04-01 11:51:11 +01:00
matt335672
275eaf7683 Rework transport connect logic
There are a number of ways the existing transport connect logic in
trans_connect could be improved for POSIX compatibility, and also
slightly tidied up:-
1) The same socket is re-used for multiple connect attempts following
   failure which isn't behaviour defined by POSIX.1-2017 (although it
   works on Linux).
2) An asynchronous connect is started, and then after a short
   delay connect() is called again on the same socket. POSIX.1-2017
   is clear that in this situation EALREADY is returned before the
   connection is established, but is silent on the behaviour expected
   when the connection is established. Returning success is an option,
   but so is returning EISCONN. The current code assumes the connect()
   call will succeed.
3) The code contains two virtually identical, quite complex loops for
   TCP and UNIX sockets, differing only in the calls to create a socket
   and connect it.
4) trans_connect() contains looping and retry logic, but this isn't
   seen as sufficient by the chansrv connect code in xrdp/xrdp_mm.c and
   the Xorg connect code in xup/xup.c. Both of these implement their own
   looping and retry logic on top of the logic in trans_connect(),
   resulting in slightly unpredictable behaviour with regard to
   timeouts.
5) A socket number can technically be zero, but in a couple of places
   this isn't allowed for.

This PR attempts to correct the implementation of trans_connect(),
and also to simplify the areas it is called from.

As part of the PR, the signature of the server_is_term member of the
xrdp module interface is changed to match the signature expected by the
is_term member of a struct trans. This allows for trans_connect()
in xrdp modules to directly access g_is_term() within the main xrdp
executable. At the moment this functionality is only used by the xup
module.
2022-03-31 20:48:07 +01:00
matt335672
cd1af4772c
Merge pull request #2201 from matt335672/neutrinordp_regression
Fix neutrinordp regression caused by bd9147d1
2022-03-29 10:59:15 +01:00
matt335672
d2be050911 Fix neutrinordp regression caused by bd9147d18f 2022-03-29 10:40:32 +01:00
matt335672
bf16cb5f2a
Merge pull request #2198 from matt335672/start_log_before_config
Open log in sesman before reading config
2022-03-29 09:34:16 +01:00
matt335672
46e23ebcab
Merge pull request #1895 from Nexarian/unify_monitor_description_processing_resize_sec
Unify monitor processing logic.
2022-03-29 09:32:39 +01:00
matt335672
104304aad1 Open log in sesman before reading config 2022-03-28 19:00:23 +01: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
Christopher Pitstick
4a0db63be7 Unify monitor processing logic.
There are two places where monitor descriptions are passed through the
RDP protocol:

- TS_UD_CS_MONITOR ([MS-RDPBCGR] 2.2.1.3.6 Client Monitor Data)
- DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT ([MS-RDPEDISP] 2.2.2.2)

The processing logic for both of them is similar enough that they should be unified.

Also update to define the constants for the maximum and minimum desktop width/height for monitors and total area.

Also a large number of clarifications for the constants and protocol
requirements.

Note that this is also the first step to making resizing work with the extension GFX channel as well as an important
foundational step to enable HiDPI compatibility.

Also some misc logging updates.
2022-03-26 23:45:16 -04:00
matt335672
f3c37e2694
Merge pull request #2185 from matt335672/xrdpapi_linker_fix
Explicitly link libxrdpapi with libcommon
2022-03-23 09:33:19 +00:00
matt335672
d37c87a7ef Explicitly link libxrdpapi with libcommon 2022-03-22 09:28:14 +00:00
matt335672
dd968a98b0
Merge pull request #2163 from matt335672/newipc
Replace SCP V0 and V1 with new IPC mechanism
2022-03-17 11:32:19 +00:00
metalefty
4b09265483
Merge pull request #2176 from metalefty/release
Release v0.9.19
2022-03-17 13:01:23 +09:00
Koichiro IWAO
3fa6e9852b Bump version to v0.9.19 2022-03-16 10:16:44 +09:00
Koichiro IWAO
68abf67a05 Update NEWS for v0.9.19 2022-03-16 10:16:39 +09:00
Koichiro IWAO
0ad7bac693 Update NEWS for v0.9.18.1 2022-03-16 10:16:39 +09:00
matt335672
3d91ba6a22 libipm: Make sockets always non-blocking 2022-03-15 10:45:00 +00:00
matt335672
8e27f231fd Add fail2ban logging to PAM authentication requests 2022-03-15 10:45:00 +00:00
matt335672
1746ac2f79 Remove SCP V0 and V1 files 2022-03-15 10:45:00 +00:00
matt335672
bb820cca87 tools: Moved to new SCP interface 2022-03-15 10:45:00 +00:00
matt335672
a952ff8542 Remove unused tcp module from tools 2022-03-15 10:45:00 +00:00
matt335672
32f644a907 Removed sestest utility 2022-03-15 10:45:00 +00:00
matt335672
a55992b1a0 Move xrdp to new SCP interface 2022-03-15 10:45:00 +00:00
matt335672
c0cb03801c Move sesman to new SCP interface 2022-03-15 10:45:00 +00:00
matt335672
6cf053c9df Add libipm test suite 2022-03-15 10:23:27 +00:00
matt335672
e059336dff Add libipm facility 2022-03-15 10:23:27 +00:00
matt335672
8f4860cb55 Add subclassing capability to struct trans 2022-03-15 10:23:27 +00:00
matt335672
d5f99f41ac Add autotools SIZEOF_INT macro 2022-03-15 10:23:27 +00:00
matt335672
2ec28aca62
Merge pull request #2168 from matt335672/fix_sesman_signals
Fix sesman signal processing
2022-03-15 09:53:16 +00: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
a94ddce0bd logging : Remove processing for unused variables 2022-03-03 17:02:18 +00:00
matt335672
fcd991844a sesman : Move global declarations to sesman.h 2022-03-03 17:01:55 +00:00
matt335672
50028e8623
Merge pull request #2153 from matt335672/remove_extra_msg
Remove unnecessary log message (regression)
2022-02-16 12:20:48 +00:00
matt335672
b689707d15 Remove unnecessary log message 2022-02-16 11:59:56 +00:00
matt335672
4030dbad8e
Merge pull request #2152 from Nexarian/fix-minor-logging-bugs
Minor logging fixes in xrdp_iso.c
2022-02-16 10:50:35 +00:00
matt335672
df23c01c37
Merge pull request #2151 from zbstao/devel
Fixed possible infinite loop (regression on #2146)
2022-02-16 10:44:25 +00:00
zbstao
1309ea405e Fixed g_waitpid function
Fixed g_waitpid function
2022-02-15 22:32:46 +08:00
Nexarian
d23f7328f8 Minor logging fixes in xrdp_iso.c
Two logging errors found while working in these files.
2022-02-15 08:29:42 -05: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
371c0dc873
Merge pull request #2150 from Nexarian/create_xrdp_channel_header
Move DRDYNVC_STATUS_* to xrdp_channel.h
2022-02-14 20:35:02 +00:00
matt335672
8f0f848a9a
Merge pull request #2149 from Nexarian/fix-npe-log-cofig-copy
Fix NPEs in log.c
2022-02-14 20:32:13 +00:00
Nexarian
773a8f7da1 Move DRDYNVC_STATUS_* to xrdp_channel.h
These statuses are necessary for egfx resizing, as visibility to channel
status is a pre-req for closing and re-opening a channel.
2022-02-14 14:53:37 -05:00
Nexarian
a0f4d94cfe Fix NPEs in log.c
Multiple NPEs can happen in the internal_log_config_copy procedure,
and we need to address this before we merge in changes for egfx.
2022-02-14 14:45:43 -05:00
matt335672
e1c6afa38e
Merge pull request #2144 from matt335672/remove_s_check
Remove s_check() macro
2022-02-14 09:00:21 +00:00
matt335672
82b1aab9ba
Merge pull request #2146 from zbstao/devel
Fixed possible SIGCHILD signal lost
2022-02-10 16:54:22 +00:00
zbstao
35d400a899 Fixed possible SIGCHILD signal lost
When multiple(eg. 20) xrdp connections are disconnected at the same time(eg.  close all rdp client at the same time), zombie process may be spawned.
2022-02-10 22:18:14 +08:00
matt335672
e6c098e750 Remove s_check() macro 2022-02-09 10:18:15 +00:00
matt335672
a13742f097
Merge pull request #2140 from matt335672/cpprelease_27
Move to cppcheck 2.7 and bump default threads to 2
2022-02-08 09:27:43 +00:00