Commit Graph

125 Commits

Author SHA1 Message Date
matt335672
edda1b064d chansrv improved config support 2020-09-08 16:58:03 +01:00
matt335672
3c4b42b1aa Implemented resize and multimon support for VNC backend 2020-06-04 15:10:35 +01:00
Jaroslaw Osmanski
56fe961349 Fixed style and format issues. 2019-03-08 08:42:18 +01:00
Jaroslaw Osmanski
7d7e8184ae Use CHANSRV_RESTRICT_OUTBOUND_CLIPBOARD env between sesman -> chansrv 2019-03-02 16:53:15 +01:00
Koichiro IWAO
9192e95c96
sesman: fix logging after default_wm change 2018-06-16 16:44:37 +09:00
Koichiro IWAO
a39b413746
sesman: make the path of reconnect script configurable 2018-06-16 16:44:37 +09:00
Koichiro IWAO
e82f212f34
sesman: accept full path for DefaultWindowManager
Solves: #1143

Also, this idea is inspired by Fedora's patch [1]. Some distro wants to
put all scripts in libexec directory due to SELinux. This enables
distros to put such scripts anywhere.

[1] https://src.fedoraproject.org/cgit/rpms/xrdp.git/tree/xrdp-0.9.6-scripts-libexec.patch?id=02f845c1b8cea781313cf3e9efcd6d7d50341824
2018-06-16 16:44:37 +09:00
matt335672
cde5b09129 Copy the PAM session environment for the reconnect script
This provides access to variables set at login which may be
required by the script (e.g. KRB5CCNAME)
2018-05-31 10:54:38 +01:00
Koichiro IWAO
c50015122c
FreeBSD: rework setsid code
Pull request #650 is not valid to avoid run session twice.
It certainly stops running session twice but causes #1016.

In FreeBSD, sesman process will run like this. The intermediate
sesman is needed to detect session termination correctly.

xrdp-sesman (daemon)
    |
    +- xrdp-sesman (FreeBSD specific intermediate sesman)
        |
        +- xrdp-sesman (bsd sesion leader & each session)
             |
             +- Xorg
             +- startwm.sh
             +- xrdp-chansrv

To stop runninng session twice correctly, just exit before the
intermediate sesman executes Xorg, WM and chansrv.
2018-02-06 16:03:10 +09:00
Koichiro IWAO
08f847d74b
sesman: refactor, change variable names
session_variables1 -> env_names
session_variables2 -> env_values

Use the name used in callee function env_set_user(). The former names
are not clear.
2018-01-11 10:57:47 +09:00
Koichiro IWAO
dcf64e43ca
remove trailing space 2018-01-11 10:57:43 +09:00
Koichiro IWAO
26394870e5 sesman: delete socket files when session exits 2017-09-13 09:04:58 +09:00
Jay Sorg
b6bd8acef1 sesman: move auth_start_session, auth_stop_session, and auth_end to child process 2017-07-12 17:58:36 +09:00
Pavel Roskin
148afd1170 Rename file_loc.h to xrdp_sockets.h, install it
Include xrdp_sockets.h directly, not through headers.
2017-03-28 00:59:16 -07:00
Jay Sorg
4b8a33e087 sesman: move auth/pam calls to main process 2017-03-21 21:56:28 -07:00
Jay Sorg
05c599666d sesman: remove sessvc, one less process to manage 2017-03-19 17:16:36 -07:00
Pavel Roskin
58c9cb43e9 Make socket directory configurable, don't hardcode /tmp/.xrdp
Use XRDP_SOCKET_PATH in file_loc.h

Don't define any non-socket paths in file_loc.h, they should come from
the makefiles.

Define all paths unconditionally, they should not be defined elsewhere.

Pass XRDP_SOCKET_PATH as environment variable to the backends.
2017-03-17 22:25:05 -07:00
Pavel Roskin
6ed4c969f4 Eliminate APP_CC and DEFAULT_CC 2017-03-14 00:21:48 -07:00
metalefty
cc48345f40 sesman: remove unnecessary fork for FreeBSD (#650)
it is not only unnecessary but causes another bug.
2017-01-28 21:14:55 +09:00
mirabilos
6257bae23f Add GNU/kFreeBSD support (#645)
* GNU/kFreeBSD is a FreeBSD variant, for code purposes.

* GNU/kFreeBSD uses GNU/Linux-ish init scripts, however.
2017-01-26 23:02:41 -02:00
Pavel Roskin
6664aac00f Use "void" for empty argument list in declarations
In C, an empty argument list in a declaration means that the function
can accept any arguments. Use "void" instead, it means "no arguments".

C++ treats void and empty list as "no arguments".
2017-01-05 17:27:20 -08:00
BLINDAUER Emmanuel
2927eed74c - Update copyright
- remove test on filename for xauth as we know what we send
- better names for variables in xauth
- if xauth fails, exit sesman
- g_bytes_to_hexstr returns a null-teminated string, don't set it twice.
2016-12-15 22:45:12 +01:00
BLINDAUER Emmanuel
b2f4f68ab8 - move function related to xauth in own file
- use of g_bytes_to_hexstr()
- correct typos and coding syntax
- don't create auth file, xauth can do that if needed
2016-12-15 18:06:35 +01:00
BLINDAUER Emmanuel
e72957b7c9 xauth: use the authfile if not using default value 2016-12-14 10:55:45 +01:00
BLINDAUER Emmanuel
7d1fdd04b5 Cosmetic change: follow coding standard 2016-12-14 08:28:25 +01:00
BLINDAUER Emmanuel
16b6471d88 use the correct size for snprintf 2016-12-14 07:16:06 +01:00
BLINDAUER Emmanuel
0aa4b85f81 Xauth: use snprintf for setting the filename and adjust the value of computed cookie 2016-12-14 00:29:22 +01:00
BLINDAUER Emmanuel
7bd1823ceb Add xauth support to get more security for all backends 2016-12-13 13:24:15 +01:00
Koichiro IWAO
35bc7c1d65 sesman: unbreak FreeBSD build after #523 2016-12-09 10:35:21 +09:00
Pavel Roskin
04414e0fd4 Disable privilege elevation by setuid for the X server 2016-12-06 15:09:52 -08:00
Jay Sorg
f14e3dc8ac sesman: must save guid in session data 2016-12-04 17:20:01 -08:00
Jay Sorg
9a517b34f0 vnc: code cleanup 2016-12-04 15:39:10 -08:00
Jay Sorg
57905d71ad vnc: change password file to use guid hash 2016-12-03 23:12:48 -08:00
Pavel Roskin
dc60a80b86 Memory leak fix: keep X server path in the parameter list
g_cfg->xorg_params, g_cfg->vnc_params and g_cfg->rdp_params don't have
auto_free enabled, so removing an item from one of those lists won't free
its contents.

It's better not to change those lists, as they represent the actual
config file and could be reused. Instead, omit the 0th parameter (the
executable path) from copying to xserver_params.

Found by Valgrind.
2016-10-21 20:15:50 +00:00
Pavel Roskin
6fef1e4eb5 Use const pointers in function arguments when possible 2016-10-17 08:54:07 -07:00
Pavel Roskin
f7c27f05cf g_term_event is a wait object, not TCP socket, delete it correctly 2016-09-08 20:26:19 -07:00
jsorg71
8353baab3d Merge pull request #390 from proski/june21
Cleanups and C++ compatibility
2016-08-05 14:38:41 -07:00
speidy
c9b55e3691 sesman: env_set_user, fix potential bof issues 2016-07-22 04:48:37 -04:00
Pavel Roskin
c5ca0332be Use cast when applying boolean OR to enum 2016-07-08 04:29:51 +00:00
Pavel Roskin
5829323ad8 Use g_new or g_new0 when C++ compiler would complain about implicit cast 2016-07-08 04:29:49 +00:00
Pavel Roskin
77b380c0b5 Fix format warnings in log_message() calls 2016-06-21 16:30:16 -07:00
Pavel Roskin
95e1603f9d Fix recently introduced warnings in session.c
Use of tabs is fixed as well.
2016-04-21 23:03:40 -07:00
Koichiro IWAO
cf2b629462 sesman: do not hardcode Xorg/X11rdp/Xvnc executables
In RHEL and its clones, /usr/bin/Xorg is set suid-root. To execute
Xorg with user privileges, /etc/pam.d/xserver needs be edited [1],
or suid bit of Xorg binary needs to be dropped.

In order to keep Xorg and /etc/pam.d/xserver untouched, preparing
non-suid version of Xorg as /usr/bin/Xorg.non-suid for example is
the simplest solution. However, Xorg.non-suid cannot be executed
since it is hardcoded to execute Xorg in sesman.

This change makes more flexible to execute Xorg with non-standard
name or not in PATH environment variable.

[1] https://www.centos.org/forums/viewtopic.php?t=21185
2016-04-07 18:34:43 +09:00
Jay Sorg
689ffe79d9 fix warnings, move some calls to os_calls 2016-03-16 14:32:14 -07:00
Pavel Roskin
92a6833e9b Fix typos 2016-02-13 20:41:07 -08:00
Pavel Roskin
fe055e989a Fix connection month display in xrdp-sesadmin
tm_mon in `struct tm` uses 0 for January.

`struct session_data` and `struct SCP_DISCONNECTED_SESSION` don't specify
how dates are stored. But considering the code in sestest and sesadmin,
all date components are stored as displayed.
2016-02-13 18:31:47 -08:00
Jay Sorg
4e0d0f3ba0 sesman: remove the thread 2015-12-11 20:41:17 -08:00
Jan Losinski
844f01b937 Simplify session match logic.
The session match logic had two versions - one for the
SESMAN_SESSION_TYPE_XRDP and SESMAN_SESSION_TYPE_XORG sessions and one
for every other type. The only difference was, that different display
sizes where ignored when searching for sessions to reconnect if the
policy does not have the SESMAN_CFG_SESS_POLICY_D flag set and the type
is SESMAN_SESSION_TYPE_XRDP or SESMAN_SESSION_TYPE_XORG.

The reason was that xvnc cannot resize and the others can do. This two
versions where not necessary because we set the
SESMAN_CFG_SESS_POLICY_D flag every time we have a xvnc session a few
lines above. So the two branches for the different types can be reduced
to one.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
2015-10-25 23:25:19 +01:00
Jay Sorg
7889ee638e sesman: close sync and term sockets after fork 2015-09-27 01:26:22 -07:00
Blindauer Emmanuel
12092e8098 Allow to reconnect with a different size while using the Xorg module 2015-08-19 07:42:00 +02:00