Commit Graph

4581 Commits

Author SHA1 Message Date
matt335672
02a3821f4d Remove libipm_msg_in_start()
The semantics of this call allowed it to be called more than once when
parsing a message to restart a parse. This is not likely to be
useful in practice, and it also makes reading file descriptors
more complicated. Consequently this function has been removed and
replaced with with libipm_msg_in_get_msgno()
2023-01-30 14:31:16 +00:00
matt335672
2c6419475c Add basic tests for os_calls routines 2023-01-30 14:31:16 +00:00
matt335672
a5034e3572 Implement g_sck_send_fd_set() and g_sck_recv_fd_set() 2023-01-30 14:31:16 +00:00
matt335672
57bd1be5b1 Disable stdout buffering for LOG() when running tests
Normally the test runners run in 'forking mode'. When a lot of
messages are logged to stdout, the child process can still be writing
data when the parent writes 'ok' or 'not ok'. This can confuse
the tap-driver.sh process.
2023-01-30 14:31:16 +00:00
matt335672
1fbcdffff1 Use unsigned int for some data lengths 2023-01-30 14:31:16 +00:00
matt335672
3183f54088
Merge pull request #2520 from matt335672/cppcheck_2_10
Bump cppcheck version to 2.10
2023-01-29 16:20:57 +00:00
matt335672
0cbdeecf14 Bump cppcheck version to 2.10 2023-01-29 15:59:28 +00:00
Nexarian
29ef7f896a
Merge pull request #2511 from Nexarian/egfx_tests
A simple working unit test for the newly introduced EGFX functions
2023-01-24 17:43:07 -05:00
Nexarian
db5ea2f214 Initial EGFX tests.
- Rearranging imports.
- Remove unnecessary check to g_is_wait_obj_set.
- Use g_get_term everywhere.
- Misc updates.
2023-01-23 23:05:24 -05:00
matt335672
59f2ae39dd
Merge pull request #2504 from matt335672/check_pcsc_sock_create_err
Don't try to listen on the scard socket if it isn't there
2023-01-18 14:37:27 +00:00
matt335672
5f030a95b7 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-16 13:41:18 +00:00
Nexarian
8fdb0fab39
Merge pull request #2338 from Nexarian/add_egfx_base_functions
Adding egfx base functions.
2023-01-15 01:59:30 -05:00
Nexarian
af8995e022 Adding egfx base functions.
- This isn't hooked up to anything yet. That will come later with
  further EGFX commits.
- There are some TODO items in this code around the way XRDP handles
  caps negotiation and monitor storage.
- This is a great candidate for unit testing in the future.
2023-01-15 01:46:47 -05:00
matt335672
9b846b7b7e
Merge pull request #2473 from matt335672/bsd_setusercontext
Implement BSD setusercontext
2023-01-13 11:24:09 +00:00
matt335672
1ea175e0c9
Merge pull request #2493 from matt335672/libipm_minor_inconsistency
Fix minor inconsistencies
2023-01-09 15:01:18 +00:00
matt335672
305db83de0 Fix Doxygen warnings 2023-01-09 14:25:27 +00:00
matt335672
dfc636f587 Fix parameter order inconsistency.
The parameter odering of some of the append routines is
inconsistent both with the function comment headers, and
with libipm_recv.c
2023-01-09 14:24:14 +00:00
matt335672
ad7cb5c726
Merge pull request #2489 from matt335672/remove_x11rdp
Remove support for x11rdp
2023-01-09 11:56:20 +00:00
matt335672
06beb07c68
Merge pull request #2490 from matt335672/freebsd_make_check
Add 'make check' to FreeBSD CI
2023-01-06 14:38:01 +00:00
matt335672
2856995089 Add 'make check' to FeeBSD CI 2023-01-06 11:43:54 +00:00
matt335672
b98c49ed95
Merge pull request #2487 from matt335672/no_pwd_no_autologin
Disable autologon for empty passwords
2023-01-06 10:38:10 +00:00
matt335672
af69606e0b Remove support for x11rdp
X11rdp has been deprecated now since xrdp v0.9.7 (June 2018). This
commit removes support for it from xrdp itself.
2023-01-05 11:26:44 +00:00
matt335672
a35082e6c5 Call g_set_allusercontext() on appropriate systems 2023-01-05 10:52:08 +00:00
matt335672
48e46d183a Add g_setallusercontext() for *BSD systems 2023-01-05 10:52:08 +00:00
matt335672
cd58d14cef Fix compilation on OpenBSD 2023-01-05 10:52:08 +00:00
matt335672
bef2e3b1e4
Merge pull request #2472 from matt335672/implement-uds-auth
Implement uds authentication
2023-01-05 10:43:13 +00:00
matt335672
d8c8b22589 Disable autologon for empty passwords
Although there is nothing in the specification to prevent automatic
logons with empty passwords, this is not a secure default.

The autologon flag INFO_AUTOLOGON ([MS-RDPBCGR] 2.2.1.11.1.1) is now
ignored for empty passwords.
2022-12-30 10:28:57 +00:00
matt335672
8a0a0249b2 Ignore xrdp-authtest in 'git status' 2022-12-22 11:35:02 +00:00
matt335672
47ace4acfd Fix g_sck_get_peer_cred() on FreeBSD
Socket level should be SOL_LOCAL rather than SOL_SOCKET - See
'man unix'.
2022-12-22 11:35:02 +00:00
matt335672
1a48527df9 Update xrdp for separate AA and session creation
xrdp is updated to use the separate authenticate/authorization (AA) and
command processing interface now provided by sesman.

PAM processing has been removed entirely and moved into the seman PAM
module. As a result, gateway processing for proxy use-cases can be
made use of by non-PAM systems.
2022-12-22 11:35:02 +00:00
matt335672
851bed680c Update sesman tools for new interfaces
The sesman tools sesrun and sesadmin now use the separate
authentication/authorization (AA) interface introduced to
sesman by the previous comment.

sesrun can use either password or UDS authentication. With some
limitations, this can allow for automatic creation of sessions for local
users without a password being needed.

sesadmin now operates using UDS logins only and so a username and
password are not required. To use sesadmin for another user, use
su/sudo/doas to authenticate as the other user.
2022-12-22 11:35:02 +00:00
matt335672
fd99653957 Update sesman authentication processing
Update sesman to cope with separate authentication/authorization (AA) and
command processing.

Also, internally users are now tracked by UID rather thn username.
This addresses a problem found by some users using federated naming
services (e.g. Active Directory) where the same user can be referred to
in more than one way. See https://github.com/neutrinolabs/xrdp/issues/1823

The separation of AA in this way allows for multiple attempts to be made
on one connection to get a password right. This addresses MaxLoginRetry
not working (https://github.com/neutrinolabs/xrdp/issues/1739)
2022-12-22 11:35:02 +00:00
matt335672
c5b6479985 Update authtest utility
This change allows the authtest utility to exercise the updated
auth module interface which includes UDS authentication and
improved error logging.
2022-12-22 11:35:02 +00:00
matt335672
d2a5fcdcd8 Update other auth modules to use new interface
The previous commit introduced a new interface for the auth modules.  This
commit simply updates the other auth modules to use the new interface.

The basic auth module is also updated so that if a user has a shadow
password entry indicated, but the shadow entry cannot be found, an error
is logged rather than silently succeeding.

The BSD authentication module is also updated to allow it to be
compiled on a Linux system for basic testing.
2022-12-22 11:35:02 +00:00
matt335672
2a3cec4125 Update PAM auth module for UDS logins
An extra method auth_uds() is added to the PAM module to
allow a 'struct auth_info' to be created for a UDS login. The PAM stack
is used to check the UDS user can be authorized.

Also, an error code is returned from the auth module rather than a
simple boolean. This allows a more complete status to be communicated
to the user. See https://github.com/neutrinolabs/xrdp/discussions/1921
and also #909 and #642
2022-12-22 11:35:02 +00:00
matt335672
4c4bdc9782 SCP: separate authentication from session creation
Messaging changes:-
- Implement sys_login request message with username, password and
  IP address
- Implement UDS login message for current user connected to sesman
- Implement common login response message for login requests
- Implement logout message so gateway authentications can be handled
- with login/logout messages
- Remove login info from the create session request
- Existing gateway request/response messages removed
- Add close connection message so that sesman can close terminated
  connections without displaying ERROR messages in the log.
- Add a set_peername message so clients can send a name to sesman
  for improved logging.

Other changes:-
- Add status types for logging in and session creation, so that the
  front-end can supply the user with more informative errors in the
  event of an error occurring.
- Users identities are now carried by UID rather than username, as
  xrdp and sesman are guaranteed to be on the same machine.
2022-12-22 11:35:02 +00:00
matt335672
891efed9ad Remove nested includes from sesman.h
The intention is to improve decoupling of the modules making up
sesman.
2022-12-22 11:35:02 +00:00
matt335672
a16e56f711 Add function to get user information by UID
Moving to a uid_t to store the user information makes a lot
of sense. When doing this, we need a function to get information
about a user from the uid_t

As well as creating the function g_getuser_info_by_uid() we also
rename g_getuser_info() to g_getuser_info_by_name() and make the
parameter ordering more usual.
2022-12-22 11:35:02 +00:00
matt335672
752b4bcaa5
Merge pull request #2481 from otaconix/patch-1
Tiny fix in pseudocode description of startwm.sh
2022-12-22 11:16:18 +00:00
otaconix
c04bf92552
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 🙂
2022-12-21 11:54:05 +01:00
matt335672
a4fb635a5d
Merge pull request #2453 from matt335672/update_kerberos
Fix the kerberos module
2022-12-14 10:44:31 +00:00
matt335672
a6714225e6 Changes to verify_user_kerberos.c 2022-12-13 11:09:33 +00:00
matt335672
767d861df4 Add authtest
Also, change the sesman Makefile generation to make it easy to pick the
correct authorization module for the authtest utility.
2022-12-13 11:09:33 +00:00
metalefty
36f3c4307c
Merge pull request #2467 from matt335672/fix_slackbuild_missing_file
Add xrdp-sesman.system to distributed files
2022-12-13 09:23:48 +09:00
matt335672
cce78b0698
Merge pull request #2407 from alexpevzner/devel
LogFile=- redirects log to stdout, which is useful for debugging
2022-12-12 20:33:04 +00:00
matt335672
df83fbf9bf Fix const-correctness for g_system() 2022-12-12 19:52:27 +00:00
matt335672
ee8c4ddc2f Add xrdp-sesman.system to distributed files
Distributed file list also now sorted for ease of checking
2022-12-12 19:41:39 +00:00
Alexander Pevzner
5d6123a046 Documentation of log file redirection to <stdout> updated
Since multiple processes can write logs simultaneously, and there
is no explicit synchronization between them, logs redirected to
stdout may interleave. When logging to the disk file, synchronization
is obtained by using a combination of O_APPEND and O_SYNC flags when
log file is being opened, which is not possible when <stdout>
redirection is in use.

So documentation is updated to cleanly notify that this is debug-only
feature, not for regular use
2022-12-12 19:14:54 +03:00
metalefty
321f124c73
Merge pull request #2459 from matt335672/pcscd_sock_permissions
Set permissions on pcsc socket dir to owner only
2022-12-10 21:11:44 +09:00
matt335672
99ca31a546
Merge pull request #2463 from matt335672/cherry_pick_cves
Cherry pick cves
2022-12-09 18:27:38 +00:00