Commit Graph

144 Commits

Author SHA1 Message Date
matt335672
4183d8ddbf Moved initgroups call to before auth_start_session()
This is required for PAM systems that depend on group membership being
available during PAM processing. This is used by pam_group on FreeBSD
and pam_group on Linux-PAM, although the functionality of both is
different.
2022-04-05 16:07:26 +01:00
matt335672
c0cb03801c Move sesman to new SCP interface 2022-03-15 10:45:00 +00:00
matt335672
8bd597a038 Fix signal handling in sesman 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
8b9b22c773 Create shared GUID module to simplify session guid handling 2021-11-25 13:29:55 +00:00
matt335672
5fb621ca53 Logged IP address for fail2ban on login failure 2021-10-25 11:35:35 +01:00
matt335672
60016c1f75 Rename client_ip to connection_description 2021-10-25 11:35:35 +01:00
matt335672
d4c81229ba Module testing now OK 2021-07-27 13:36:34 +01:00
Jay Sorg
738e346f81 sesman: work on moving sesman to trans, v0 scp working 2021-07-27 13:35:43 +01:00
Alexandre Quesnel
52707ac686 Fixing formatting with astyle 2021-05-08 16:58:11 +00:00
Alexandre Quesnel
cbf6adb4be Adding logs to sesman/session.c 2021-04-14 04:41:54 +00:00
matt335672
0a1a8f40e5 Moved a lot of string funcs to string_calls module 2020-12-22 11:57:24 +00:00
metalefty
785db575ca
Merge pull request #1751 from matt335672/address-minor-user-comments
Cosmetic fixes for minor issues
2020-12-21 16:12:58 +09:00
Koichiro IWAO
31214f15a6
sesman: reflect review suggestions on cleanup_sockets
* Use LOG_LEVEL_WARNING for the deletion failure
* Log the error condition when the deletion failed
2020-12-21 13:28:53 +09:00
Koichiro IWAO
5114d1ee64 sesman: address the issue of socket file leftovers
There are two points.

Make sure cleanup files happen after chansrv and Xserver exit. If these
child processes lock socket files, the deletion might fail.

Usually, cleanup of xorgxrdp related socket files is handled by
xorgxrdp. Just in case it failed, perform cleanup also in sesman.

Fixes #1740. Thanks to @matt335672.

Sponsored by:   Cybertrust Japan
Sponsored by:   HAW International
2020-12-18 18:30:49 +09:00
matt335672
7ddc43aeea Cosmetic fixes for minor issues 2020-12-14 11:35:31 +00:00
Alexandre Quesnel
0c61a15fc5 Migrating logging to LOG() and LOG_DEVEL() in sesman/* 2020-11-30 00:36:20 +00:00
D.V.Yacenko
a6a785d7a4
Allow parameters for XRDP run bash script
Allows run bash script with parameters on xrdp. For example rdesktop -s "myscript.sh params"
2020-10-22 16:12:55 +01:00
Alexandre Quesnel
a9ec1ebd99 Unifying logging in chanserv
This commit adds:
* replace multiple logging macros with LOG and LOG_DEVEL
* logging configuration for chanserv
* logging configuration for console output
* logging configuration for per file or method log level filtering for
debug builds
* file, line, and method name in log message for debug builds
2020-10-19 05:10:47 +00:00
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