Commit Graph

1081 Commits

Author SHA1 Message Date
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
Daniel Richard G 42d32e7496 Use config_ac.h consistently and correctly 2023-05-12 13:49:53 -04:00
matt335672 8853b1c4ee New files for sesexec 2023-05-02 11:55:23 +01:00
matt335672 4dcaa84fbe Changes to autotools stuff for sesexec 2023-05-02 11:55:23 +01:00
matt335672 c5971b535d sesexec: Changes to existing files from sesman
env.c : The value of XRDP_SESSION in the environment is now set to the
        PID of the sesexec process, which ties up the session with the
        output of "xrdp-sesadmin -c=list".

        Later versions of xrdp-sesadmin can use this value to get
        information about the current process.
2023-05-02 11:55:23 +01:00
matt335672 74cd7d1837 Rework sesman with new files 2023-05-02 11:55:23 +01:00
matt335672 3895954b75 Add libipm interfaces to sesman
Add modules to sesman to handle incoming EICP and ERCP messages
2023-05-02 11:55:22 +01:00
matt335672 9c2c43693c Move files from sesman to sesexec directory 2023-05-02 11:55:22 +01:00
matt335672 8e291846d5 Create pre-session list
This is made from the old sesman_con structure. It describes
a connection to sesman which is not yet running a session.
2023-05-02 11:55:22 +01:00
matt335672 dadb393443 Add sesexec control module
This module provides a secure way for sesman to start the sesexec program
and establish a private communications channel with it.
2023-05-02 11:55:22 +01:00
matt335672 3d95954d87 Move session_list to struct list *
This commit now uses the standard list module to manage the active
session list, rather than having special code to do this.
2023-05-02 11:55:22 +01:00
matt335672 1a9d15bef0 Remove explicit auth_stop_session() call
Now that authentication/authorization and session creation are
happening in the same process, there is no need for a separate call
to finish an auth session. This change prevents the upper software
layers from needing to track whether auth_start_session() has been
called or not.
2023-05-02 11:55:22 +01:00
matt335672 82ede29388 libsesman: Make x11_display_offset and max_sessions unsigned 2023-05-02 11:55:22 +01:00
matt335672 06580ec448 sesman config: Add MaxDisplayNumber
When allocating a display number, we should be aware that
IANA only allow TCP displays up to :63. This PR adds that restriction in
to sesman.ini as a default, to prevent us allocating unavailable TCP
ports.

By default TCP ports are not enabled for X servers, but users can easily
change this if they wish to access X displays directly over the network.

This restriction is in addition to the MaxSessions limit already present
in sesman.ini
2023-05-02 11:55:22 +01:00
matt335672 970d936106 libsesman config: Define default sesman.ini name 2023-05-02 11:55:22 +01:00
matt335672 e96d77bac1 Remove g_mk_socket_path() from codepaths
The socket dir is only used if we are starting a session
with sesman. Consequently, it only makes sense to create
this directory within sesman itself.
2023-05-02 11:55:22 +01:00
matt335672 563cfaf009
Merge pull request #2643 from matt335672/close_unwanted_fds
Fix leaking file descriptors
2023-05-02 11:54:05 +01:00
matt335672 b3b12b1be5 Allow longer UserWindowManager strings
The UserWindowManager is limited to 31 characters. There appears
to be no good reason for this.
2023-05-01 11:52:21 +01:00
matt335672 f08355a325 Ensure commonly used file descriptors are close-on-exec 2023-04-24 14:20:14 +01:00
matt335672 adb7476187 Add LOG_DEVEL_LEAKING_FDS calls to the application 2023-04-24 14:20:14 +01:00
Lennart Sauerbeck 5741653900 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-19 10:16:56 +01:00
Jay Sorg 6628d57b55 chansrv: build fix, use libipm from build dir 2023-04-03 22:25:06 -07:00
matt335672 5605ce44b1 Remove defines from sesman_config.h
This file currently contains defines which are only used in
sesman_config.c Moving them into there increases readability
and maintainability.
2023-03-30 13:07:49 +01:00
matt335672 53cc5c3e18 Remove unnecessary comment 2023-03-30 13:07:49 +01:00
matt335672 5e339d5054 Update sesman test tools after libsesman created 2023-03-30 13:07:49 +01:00
matt335672 8044bd1ecf Update sesman files left after libsesman created 2023-03-30 13:07:49 +01:00
matt335672 ea12231247 Updaste chansrv files related to new libsesman 2023-03-30 13:07:49 +01:00
matt335672 d2362f23a0 Fix typo 2023-03-30 13:07:49 +01:00
matt335672 b4f9d250e2 Update sesman files moved to libsesman 2023-03-29 14:31:30 +01:00
matt335672 75c9979b54 Add new files to libsesman 2023-03-29 14:31:30 +01:00
matt335672 2f3693b3dc autotools changes related to new libsesman library 2023-03-29 14:31:30 +01:00
matt335672 d05dd853bb Moved sesman_access module into libsesman 2023-03-29 14:31:30 +01:00
matt335672 2995d4942f Renamed sesman/access module 2023-03-29 14:31:30 +01:00
matt335672 dff380fb78 Move auth modules into libsesman 2023-03-29 14:31:30 +01:00
matt335672 d83bf100fa Move auth into libsesman 2023-03-29 14:31:30 +01:00
matt335672 cf5c1494cf Rename auth.h as sesman_auth.h 2023-03-29 14:31:29 +01:00
matt335672 db1f4c95a6 Moved config into libsesman 2023-03-29 14:31:29 +01:00
matt335672 f24400f4f1 Renamed sesman/config module 2023-03-29 14:31:29 +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 991770cc5d Refactored session.c to support X server validation 2023-03-24 10:58:42 +00:00
matt335672 34ad55faa6 xwait changes (breaks compile)
The wait_for_xserver() call is refactored so that it can
be called from root context to wait for an X server run by
a specific user.
2023-03-24 10:54:04 +00:00
matt335672 6bf0aed8dd Make wait objects private to sesman.c 2023-03-24 10:54:04 +00:00
matt335672 5cb5542d91 Rename session_list module functions
Rename functions in the session_list module so it's clearer where
they are defined.
2023-03-24 10:53:23 +00:00
matt335672 fb25de0419 Split sesman/session.c into session.c and session_list.c 2023-03-23 18:12:06 +00:00
matt335672 84c19e05ce Duplicate session module to session_list module
This makes an exact copy of session.[ch] in session_list.[ch].
The intention is to be able to follow changes in git with
the --follow switch
2023-03-23 18:12:06 +00:00
matt335672 c0b9bf9a37 Remove clone_session_params()
This is a hangover from SCP V1 and is no longer required with
the move to libipm
2023-03-23 18:12:06 +00: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